1<?xml version="1.0" encoding="ISO-8859-1"?>
2<?xml-stylesheet type="text/xsl" href="jvmti.xsl"?>
3<!--
4 Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
5 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6
7 This code is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License version 2 only, as
9 published by the Free Software Foundation.
10
11 This code is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 version 2 for more details (a copy is included in the LICENSE file that
15 accompanied this code).
16
17 You should have received a copy of the GNU General Public License version
18 2 along with this work; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
21 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 or visit www.oracle.com if you need additional information or have any
23 questions.
24-->
25
26<!DOCTYPE specification [
27   <!ELEMENT specification (title, copyright, 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 copyright ANY>
38
39   <!ELEMENT intro ANY>
40   <!ATTLIST intro id CDATA #IMPLIED
41                   label CDATA "">
42
43   <!ELEMENT functionsection (intro*, category*)>
44   <!ATTLIST functionsection label CDATA #REQUIRED>
45
46   <!ELEMENT category ((intro|typedef|uniontypedef|capabilitiestypedef)*,
47                          (function|callback|elide)*)>
48   <!ATTLIST category id CDATA #REQUIRED
49                      label CDATA #REQUIRED>
50
51   <!ELEMENT function (synopsis, typedef*, description?, origin,
52                         (capabilities|eventcapabilities),
53                         parameters, errors)>
54   <!ATTLIST function id CDATA #REQUIRED
55                      num CDATA #REQUIRED
56                      phase (onload|onloadOnly|start|live|any) #IMPLIED
57		      callbacksafe (safe|unsafe) #IMPLIED
58                      impl CDATA #IMPLIED
59                      hide CDATA #IMPLIED
60                      jkernel (yes|no) #IMPLIED
61                      since CDATA "1.0">
62
63   <!ELEMENT callback ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
64                        jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void),
65                        synopsis, description?, parameters)>
66   <!ATTLIST callback id CDATA #REQUIRED
67                      since CDATA "1.0">
68
69   <!ELEMENT synopsis (#PCDATA|jvmti)*>
70
71   <!ELEMENT typedef (description?, field*)>
72   <!ATTLIST typedef id CDATA #REQUIRED
73                     label CDATA #REQUIRED
74                     since CDATA "1.0">
75
76   <!ELEMENT uniontypedef (description?, field*)>
77   <!ATTLIST uniontypedef id CDATA #REQUIRED
78                     label CDATA #REQUIRED
79                     since CDATA "1.0">
80
81   <!ELEMENT field ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
82                     jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|allocfieldbuf|inptr|inbuf|outbuf|vmbuf|ptrtype|struct),
83                    description)>
84   <!ATTLIST field id CDATA #REQUIRED>
85
86   <!ELEMENT capabilitiestypedef (description?, capabilityfield*)>
87   <!ATTLIST capabilitiestypedef id CDATA #REQUIRED
88                     label CDATA #REQUIRED>
89
90   <!ELEMENT capabilityfield (description)>
91   <!ATTLIST capabilityfield id CDATA #REQUIRED
92                   disp1 CDATA ""
93                   disp2 CDATA ""
94                   since CDATA "1.0">
95
96   <!ELEMENT description ANY>
97
98   <!ELEMENT capabilities (required*, capability*)>
99
100   <!ELEMENT eventcapabilities EMPTY>
101
102   <!ELEMENT required ANY>
103   <!ATTLIST required id CDATA #REQUIRED>
104
105   <!ELEMENT capability ANY>
106   <!ATTLIST capability id CDATA #REQUIRED>
107
108   <!ELEMENT parameters (param*)>
109
110   <!ELEMENT param ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
111                     jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct|ptrtype|
112                     outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf),
113                    description)>
114   <!ATTLIST param id CDATA #REQUIRED>
115
116   <!ELEMENT jmethodID EMPTY>
117   <!ATTLIST jmethodID class  CDATA #IMPLIED
118                       native CDATA #IMPLIED>
119
120   <!ELEMENT jfieldID EMPTY>
121   <!ATTLIST jfieldID class CDATA #IMPLIED>
122
123   <!ELEMENT jclass EMPTY>
124   <!ATTLIST jclass method CDATA #IMPLIED
125                    field  CDATA #IMPLIED>
126
127   <!ELEMENT jframeID EMPTY>
128   <!ATTLIST jframeID thread CDATA #IMPLIED>
129
130   <!ELEMENT jrawMonitorID EMPTY>
131
132   <!ELEMENT jthread EMPTY>
133   <!ATTLIST jthread started CDATA #IMPLIED
134                     null CDATA #IMPLIED
135                     frame CDATA #IMPLIED
136                     impl CDATA #IMPLIED>
137
138   <!ELEMENT varargs EMPTY>
139
140   <!ELEMENT jthreadGroup EMPTY>
141   <!ELEMENT jobject EMPTY>
142   <!ELEMENT jvalue EMPTY>
143   <!ELEMENT jchar EMPTY>
144   <!ELEMENT jint EMPTY>
145   <!ATTLIST jint min CDATA #IMPLIED>
146   <!ELEMENT jlong EMPTY>
147   <!ELEMENT jfloat EMPTY>
148   <!ELEMENT jdouble EMPTY>
149   <!ELEMENT jlocation EMPTY>
150   <!ELEMENT jboolean EMPTY>
151   <!ELEMENT char EMPTY>
152   <!ELEMENT uchar EMPTY>
153   <!ELEMENT size_t EMPTY>
154   <!ELEMENT void EMPTY>
155   <!ELEMENT enum (#PCDATA)*>
156   <!ELEMENT struct (#PCDATA)*>
157
158   <!ELEMENT nullok ANY>
159
160   <!ELEMENT ptrtype     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
161                                   jthreadGroup|jobject|jvalue), nullok?)>
162
163   <!ELEMENT outptr     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
164                                   jthreadGroup|jobject|jvalue|enum|jchar|jint|jlong|jfloat|jdouble|
165                                   jlocation|jboolean|char|uchar|size_t|void), nullok?)>
166
167   <!ELEMENT allocbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
168                                   jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
169                                   jlocation|jboolean|char|uchar|size_t|void), nullok?)>
170   <!ATTLIST allocbuf incount CDATA #IMPLIED
171                      outcount CDATA #IMPLIED>
172
173   <!ELEMENT allocallocbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
174                                   jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
175                                   jlocation|jboolean|char|uchar|size_t|void), nullok?)>
176   <!ATTLIST allocallocbuf incount CDATA #IMPLIED
177                      outcount CDATA #IMPLIED>
178
179   <!ELEMENT inptr      (struct, nullok?)>
180
181   <!ELEMENT inbuf      ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
182                                   jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
183                                   jlocation|jboolean|char|uchar|size_t|void), nullok?)>
184   <!ATTLIST inbuf    incount CDATA #IMPLIED>
185
186   <!ELEMENT outbuf     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
187                                   jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
188                                   jlocation|jboolean|char|uchar|size_t|void|outbuf), nullok?)>
189   <!ATTLIST outbuf   incount CDATA #IMPLIED
190                      outcount CDATA #IMPLIED>
191
192   <!ELEMENT vmbuf      ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
193                                   jthreadGroup|jobject|jvalue|enum|jchar|jint|jlong|jfloat|jdouble|
194                                   jlocation|jboolean|char|uchar|size_t|void), nullok?)>
195   <!ATTLIST vmbuf    incount CDATA #IMPLIED
196                      outcount CDATA #IMPLIED>
197
198   <!ELEMENT agentbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
199                                   jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
200                                   jlocation|jboolean|char|uchar|size_t|void), nullok?)>
201   <!ATTLIST agentbuf incount CDATA #IMPLIED
202                      outcount CDATA #IMPLIED>
203
204   <!ELEMENT allocfieldbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
205                                   jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
206                                   jlocation|jboolean|char|uchar|size_t|void))>
207   <!ATTLIST allocfieldbuf outcount CDATA #IMPLIED>
208
209   <!ELEMENT errors (error*)>
210
211   <!ELEMENT error ANY>
212   <!ATTLIST error id CDATA #REQUIRED>
213
214   <!ELEMENT errorsection (intro*, errorcategory*)>
215   <!ATTLIST errorsection label CDATA #REQUIRED>
216
217   <!ELEMENT errorcategory (intro*, errorid*)>
218   <!ATTLIST errorcategory id CDATA #REQUIRED
219                           label CDATA #REQUIRED>
220
221   <!ELEMENT errorid ANY>
222   <!ATTLIST errorid id CDATA #REQUIRED
223                     num CDATA #REQUIRED>
224
225   <!ELEMENT datasection (intro*, basetypes*)>
226
227   <!ELEMENT basetypes (intro*, basetype*)>
228   <!ATTLIST basetypes id CDATA #REQUIRED
229                       label CDATA #REQUIRED>
230
231   <!ELEMENT basetype (definition?,description)>
232   <!ATTLIST basetype id CDATA #REQUIRED
233                      name CDATA #IMPLIED>
234
235   <!ELEMENT definition (#PCDATA|jvmti)*>
236
237   <!ELEMENT eventsection (intro*, (event|elide)*)>
238   <!ATTLIST eventsection label CDATA #REQUIRED>
239
240   <!ELEMENT event (description, origin, typedef*, capabilities, parameters)>
241   <!ATTLIST event id CDATA #REQUIRED
242                   label CDATA #REQUIRED
243                   const CDATA #REQUIRED
244                   num CDATA #REQUIRED
245                   phase (onload|start|live|any) #IMPLIED
246                   filtered (thread|global) #IMPLIED
247                   since CDATA "1.0">
248
249   <!ELEMENT issuessection (intro*)>
250   <!ATTLIST issuessection label CDATA #REQUIRED>
251
252   <!ELEMENT changehistory (intro*, change*)>
253   <!ATTLIST changehistory update CDATA #REQUIRED
254                           id CDATA #REQUIRED>
255
256   <!ELEMENT change ANY>
257   <!ATTLIST change date CDATA #REQUIRED
258                    version CDATA #IMPLIED>
259
260   <!ELEMENT functionlink (#PCDATA|jvmti|code|i|b)*>
261   <!ATTLIST functionlink id CDATA #REQUIRED>
262
263   <!ELEMENT datalink (#PCDATA|jvmti|code|i|b)*>
264   <!ATTLIST datalink id CDATA #REQUIRED>
265
266   <!ELEMENT typelink (#PCDATA|jvmti|code|i|b)*>
267   <!ATTLIST typelink id CDATA #REQUIRED>
268
269   <!ELEMENT fieldlink (#PCDATA|jvmti|code|i|b)*>
270   <!ATTLIST fieldlink id CDATA #REQUIRED
271                       struct CDATA #REQUIRED>
272
273   <!ELEMENT paramlink (#PCDATA|jvmti|code|i|b)*>
274   <!ATTLIST paramlink id CDATA #REQUIRED>
275
276   <!ELEMENT eventlink (#PCDATA|jvmti|code|i|b)*>
277   <!ATTLIST eventlink id CDATA #REQUIRED>
278
279   <!ELEMENT errorlink (#PCDATA|jvmti|code|i|b|tm)*>
280   <!ATTLIST errorlink id CDATA #REQUIRED>
281
282   <!ELEMENT externallink (#PCDATA|jvmti|code|i|b|tm)*>
283   <!ATTLIST externallink id CDATA #REQUIRED>
284
285   <!ELEMENT vmspec EMPTY>
286   <!ATTLIST vmspec chapter CDATA #IMPLIED>
287
288   <!ELEMENT internallink (#PCDATA|jvmti|code|i|b)*>
289   <!ATTLIST internallink id CDATA #REQUIRED>
290
291   <!ELEMENT functionphaselist EMPTY>
292   <!ATTLIST functionphaselist phase (onload|onloadOnly|start|live|any) #REQUIRED>
293
294   <!ELEMENT eventphaselist EMPTY>
295   <!ATTLIST eventphaselist phase (onload|start|live|any) #REQUIRED>
296
297   <!ELEMENT issue ANY>
298
299   <!ELEMENT rationale ANY>
300
301   <!ELEMENT todo ANY>
302
303   <!ELEMENT origin (#PCDATA)*>
304
305   <!ELEMENT elide (intro|function|callback|event)*>
306   <!ATTLIST elide why CDATA #IMPLIED>
307
308   <!ELEMENT constants (constant*)>
309   <!ATTLIST constants id CDATA #REQUIRED
310                       label CDATA #REQUIRED
311                       kind (enum|bits|const) #REQUIRED
312                       since CDATA "1.0">
313
314   <!ELEMENT constant ANY>
315   <!ATTLIST constant id CDATA #REQUIRED
316                      num CDATA #REQUIRED>
317
318   <!ELEMENT tm (#PCDATA)>
319
320   <!ELEMENT i (#PCDATA|jvmti|tm)*>
321
322   <!ELEMENT b (#PCDATA|jvmti|code)*>
323
324   <!ELEMENT code (#PCDATA|space)*>
325
326   <!ELEMENT pre ANY>
327
328   <!ELEMENT space EMPTY>
329
330   <!ELEMENT jvmti EMPTY>
331
332   <!ELEMENT example (#PCDATA|i)*>
333
334   <!ELEMENT br EMPTY>
335
336   <!ELEMENT p EMPTY>
337
338   <!ELEMENT blockquote ANY>
339
340   <!ELEMENT dl  (dt|dd)+>
341
342   <!ELEMENT dd  ANY>
343
344   <!ELEMENT dt  (#PCDATA|jvmti|code|i|b)*>
345
346   <!ELEMENT table  (tr)+>
347
348   <!ELEMENT tr  (td|th)*>
349
350   <!ELEMENT td  ANY>
351   <!ATTLIST td class CDATA #IMPLIED>
352
353   <!ELEMENT th  ANY>
354   <!ATTLIST th class CDATA #IMPLIED>
355
356   <!ELEMENT ul  (li)+>
357   <!ATTLIST ul type (disc|circle|square) "disc">
358
359   <!ELEMENT li  ANY>
360 ]>
361
362<specification label="JVM(TM) Tool Interface"
363        majorversion="11"
364        minorversion="0"
365        microversion="0">
366  <title subtitle="Version">
367    <tm>JVM</tm> Tool Interface
368  </title>
369
370  <copyright>
371    Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
372  </copyright>
373
374  <intro id="whatIs" label="What is the JVM Tool Interface?">
375    The <tm>JVM</tm> Tool Interface (<jvmti/>)
376    is a programming interface used by development and monitoring tools.
377    It provides both a way to inspect the state and
378    to control the execution of applications running in the
379    <tm>Java</tm> virtual machine (VM).
380    <p/>
381    <jvmti/> is intended to provide a VM interface for the full breadth of tools
382    that need access to VM state, including but not limited to: profiling,
383    debugging, monitoring, thread analysis, and coverage analysis tools.
384    <p/>
385    <jvmti/> may not be available in all implementations of the <tm>Java</tm> virtual
386    machine.
387    <p/>
388    <jvmti/> is a two-way interface.
389    A client of <jvmti/>, hereafter called an <i>agent</i>,
390    can be notified of
391    interesting occurrences through <internallink id="EventSection">events</internallink>.
392    <jvmti/>
393    can query and control the application through many
394    <internallink id="FunctionSection">functions</internallink>,
395    either in response to events or
396    independent of them.
397    <p/>
398    Agents run in the same process with and communicate directly with
399    the virtual machine executing
400    the application being examined.  This communication is
401    through a native interface (<jvmti/>). The native in-process interface allows
402    maximal control with minimal intrusion on the part of a tool.
403    Typically, agents are relatively compact. They can be controlled
404    by a separate process which implements the bulk of a tool's
405    function without interfering with the target application's normal execution.
406  </intro>
407
408  <intro id="architecture" label="Architecture">
409    Tools can be written directly to <jvmti/> or indirectly
410    through higher level interfaces.
411    The Java Platform Debugger Architecture includes <jvmti/>, but also
412    contains higher-level, out-of-process debugger interfaces. The higher-level
413    interfaces are more appropriate than <jvmti/> for many tools.
414    For more information on the Java Platform Debugger Architecture,
415    see the
416    <externallink id="jpda/architecture.html">Java
417      Platform Debugger Architecture website</externallink>.
418  </intro>
419
420  <intro id="writingAgents" label="Writing Agents">
421    Agents can be written in any native language that supports C
422    language calling conventions and C or C++
423    definitions.
424    <p/>
425    The function, event, data type, and constant definitions needed for
426    using <jvmti/> are defined in the include file <code>jvmti.h</code>.
427    To use these definitions add the <tm>J2SE</tm> include directory
428    to your include path and add
429    <example>
430#include &lt;jvmti.h&gt;
431    </example>
432    to your source code.
433  </intro>
434
435  <intro id="deployingAgents" label="Deploying Agents">
436    An agent is deployed in a platform specific manner but is typically the
437    platform equivalent of a dynamic library. On the <tm>Windows</tm> operating
438    system, for example, an agent library is a "Dynamic Linked Library" (DLL).
439    On the <tm>Solaris</tm> Operating Environment, an agent library is a shared
440    object (<code>.so</code> file).
441    <p/>
442
443    An agent may be started at VM startup by specifying the agent library
444    name using a <internallink id="starting">command line option</internallink>.
445    Some implementations may support a mechanism to <internallink id="onattach">
446    start agents</internallink> in the live <functionlink id="GetPhase">phase</functionlink>.
447    The details of how this is initiated are implementation specific.
448  </intro>
449
450    <intro id="entryPoint" label="Statically Linked Agents (since version 1.2.3)">
451
452      A native JVMTI Agent may be <i>statically linked</i> with the VM.
453      The manner in which the library and VM image are combined is
454      implementation-dependent.
455      An agent L whose image has been combined with the VM is defined as
456      <i>statically linked</i> if and only if the agent exports a function
457      called Agent_OnLoad_L.
458<p/>
459      If a <i>statically linked</i> agent L exports a function called
460      Agent_OnLoad_L and a function called Agent_OnLoad, the Agent_OnLoad
461      function will be ignored.
462      If an agent L is <i>statically linked</i>, an Agent_OnLoad_L
463      function will be invoked with the same arguments and expected return
464      value as specified for the Agent_OnLoad function.
465      An agent L that is <i>statically linked</i> will prohibit an agent of
466      the same name from being loaded dynamically.
467<p/>
468      The VM will invoke the Agent_OnUnload_L function of the agent, if such
469      a function is exported, at the same point during VM execution as it would
470      have called the dynamic entry point Agent_OnUnLoad. A statically loaded
471      agent cannot be unloaded. The Agent_OnUnload_L function will still be
472      called to do any other agent shutdown related tasks.
473      If a <i>statically linked</i> agent L exports a function called
474      Agent_OnUnLoad_L and a function called Agent_OnUnLoad, the Agent_OnUnLoad
475      function will be ignored.
476<p/>
477      If an agent L is <i>statically linked</i>, an Agent_OnAttach_L function
478      will be invoked with the same arguments and expected return value as
479      specified for the Agent_OnAttach function.
480      If a <i>statically linked</i> agent L exports a function called
481      Agent_OnAttach_L and a function called Agent_OnAttach, the Agent_OnAttach
482      function will be ignored.
483</intro>
484
485  <intro id="starting" label="Agent Command Line Options">
486    The term "command-line option" is used below to
487    mean options supplied in the <code>JavaVMInitArgs</code> argument
488    to the <code>JNI_CreateJavaVM</code> function of the JNI
489    Invocation API.
490    <p/>
491    One of the two following
492    command-line options is used on VM startup to
493    properly load and run agents.
494    These arguments identify the library containing
495    the agent as well as an options
496    string to be passed in at startup.
497    <dl>
498      <dt><code>-agentlib:</code><i>&lt;agent-lib-name&gt;</i><code>=</code><i>&lt;options&gt;</i></dt>
499      <dd>
500	The name following <code>-agentlib:</code> is the name of the
501	library to load.  Lookup of the library, both its full name and location,
502	proceeds in a platform-specific manner.
503	Typically, the <i>&lt;agent-lib-name&gt;</i> is expanded to an
504	operating system specific file name.
505	The <i>&lt;options&gt;</i> will be passed to the agent on start-up.
506	For example, if the option
507	<code>-agentlib:foo=opt1,opt2</code> is specified, the VM will attempt to
508	load the shared library <code>foo.dll</code> from the system <code>PATH</code>
509        under <tm>Windows</tm> or <code>libfoo.so</code> from the
510	<code>LD_LIBRARY_PATH</code> under the <tm>Solaris</tm> operating
511        environment.
512        If the agent library is statically linked into the executable
513        then no actual loading takes place.
514    <p/>
515      </dd>
516      <dt><code>-agentpath:</code><i>&lt;path-to-agent&gt;</i><code>=</code><i>&lt;options&gt;</i></dt>
517      <dd>
518	The path following <code>-agentpath:</code> is the absolute path from which
519	to load the library.
520	No library name expansion will occur.
521	The <i>&lt;options&gt;</i> will be passed to the agent on start-up.
522	For example, if the option
523	<code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code> is specified, the VM will attempt to
524	load the shared library <code>c:\myLibs\foo.dll</code>. If the agent
525        library is statically linked into the executable
526        then no actual loading takes place.
527    <p/>
528      </dd>
529    </dl>
530    For a dynamic shared library agent, the start-up routine
531    <internallink id="onload"><code>Agent_OnLoad</code></internallink>
532    in the library will be invoked. If the agent library is statically linked
533    into the executable then the system will attempt to invoke the
534    <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> entry point where
535    &lt;agent-lib-name&gt; is the basename of the
536    agent. In the above example <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code>,
537    the system will attempt to find and call the <code>Agent_OnLoad_foo</code> start-up routine.
538    <p/>
539    Libraries loaded with <code>-agentlib:</code> or <code>-agentpath:</code>
540    will be searched for JNI native method implementations to facilitate the
541    use of Java programming language code in tools, as is needed for
542    <internallink id="bci">bytecode instrumentation</internallink>.
543    <p/>
544    The agent libraries will be searched after all other libraries have been
545    searched (agents wishing to override or intercept the native method
546    implementations of non-agent methods can use the
547    <eventlink id="NativeMethodBind">NativeMethodBind event</eventlink>).
548    <p/>
549    These switches do the above and nothing more - they do not change the
550    state of the VM or <jvmti/>.  No command line options are needed
551    to enable <jvmti/>
552    or aspects of <jvmti/>, this is handled programmatically
553    by the use of
554    <internallink id="capability">capabilities</internallink>.
555  </intro>
556
557  <intro id="startup" label="Agent Start-Up">
558    The VM starts each agent by invoking a start-up function.
559    If the agent is started in the <code>OnLoad</code>
560    <functionlink id="GetPhase">phase</functionlink> the function
561    <internallink id="onload"><code>Agent_OnLoad</code></internallink>
562    or <internallink id="onload"><code>Agent_OnLoad_L</code></internallink>
563    for statically linked agents will be invoked.
564    If the agent is started in the live
565    <functionlink id="GetPhase">phase</functionlink> the function
566    <internallink id="onattach"><code>Agent_OnAttach</code></internallink>
567    or <internallink id="onattach"><code>Agent_OnAttach_L</code></internallink>
568    for statically linked agents will be invoked.
569    Exactly one call to a start-up function is made per agent.
570  </intro>
571
572  <intro id="onload" label="Agent Start-Up (OnLoad phase)">
573    If an agent is started during the <code>OnLoad</code> phase then its
574    agent library must export a start-up function with the following prototype:
575    <example>
576JNIEXPORT jint JNICALL
577Agent_OnLoad(JavaVM *vm, char *options, void *reserved)</example>
578    Or for a statically linked agent named 'L':
579    <example>
580JNIEXPORT jint JNICALL
581Agent_OnLoad_L(JavaVM *vm, char *options, void *reserved)</example>
582
583    The VM will start the agent by calling this function.
584    It will be called early enough in VM initialization that:
585    <ul>
586      <li><functionlink id="SetSystemProperty">system properties</functionlink>
587	may be set before they have been used in the start-up of the VM</li>
588      <li>the full set of
589	<internallink id="capability">capabilities</internallink>
590	is still available (note that capabilities that configure the VM
591	may only be available at this time--see the
592	<internallink id="capability">Capability function section</internallink>)</li>
593      <li>no bytecodes have executed</li>
594      <li>no classes have been loaded</li>
595      <li>no objects have been created</li>
596    </ul>
597    <p/>
598    The VM will call the <code>Agent_OnLoad</code> or
599    <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> function with
600    <i>&lt;options&gt;</i> as the second argument -
601    that is, using the command-line option examples,
602    <code>"opt1,opt2"</code> will be passed to the <code>char *options</code>
603    argument of <code>Agent_OnLoad</code>.
604    The <code>options</code> argument is encoded as a
605    <internallink id="mUTF">modified UTF-8</internallink> string.
606    If <i>=&lt;options&gt;</i> is not specified,
607    a zero length string is passed to <code>options</code>.
608    The lifespan of the <code>options</code> string is the
609    <code>Agent_OnLoad</code> or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code>
610    call.  If needed beyond this time the string or parts of the string must
611    be copied.
612    The period between when <code>Agent_OnLoad</code> is called and when it
613    returns is called the <i>OnLoad phase</i>.
614    Since the VM is not initialized during the OnLoad
615    <functionlink id="GetPhase">phase</functionlink>,
616    the set of allowed operations
617    inside <code>Agent_OnLoad</code> is restricted (see the function descriptions for the
618    functionality available at this time).
619    The agent can safely process the options and set
620    event callbacks with <functionlink id="SetEventCallbacks"></functionlink>. Once
621    the VM initialization event is received
622    (that is, the <eventlink id="VMInit">VMInit</eventlink>
623    callback is invoked), the agent
624    can complete its initialization.
625    <rationale>
626      Early startup is required so that agents can set the desired capabilities,
627      many of which must be set before the VM is initialized.
628      In JVMDI, the -Xdebug command-line option provided
629      very coarse-grain control of capabilities.
630      JVMPI implementations use various tricks to provide a single "JVMPI on" switch.
631      No reasonable command-line
632      option could provide the fine-grain of control required to balance needed capabilities vs
633      performance impact.
634      Early startup is also needed so that agents can control the execution
635      environment - modifying the file system and system properties to install
636      their functionality.
637    </rationale>
638    <p/>
639    The return value from <code>Agent_OnLoad</code> or
640    <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> is used to indicate an error.
641    Any value other than zero indicates an error and causes termination of the VM.
642  </intro>
643
644  <intro id="onattach" label="Agent Start-Up (Live phase)">
645    A VM may support a mechanism that allows agents to be started in the VM during the live
646    <functionlink id="GetPhase">phase</functionlink>. The details of how this is supported,
647    are implementation specific. For example, a tool may use some platform specific mechanism,
648    or implementation specific API, to attach to the running VM, and request it start a given
649    agent.
650    <p/>
651    If an agent is started during the live phase then its agent library
652    must export a start-up function
653    with the following prototype:
654    <example>
655JNIEXPORT jint JNICALL
656Agent_OnAttach(JavaVM* vm, char *options, void *reserved)</example>
657Or for a statically linked agent named 'L':
658    <example>
659JNIEXPORT jint JNICALL
660Agent_OnAttach_L(JavaVM* vm, char *options, void *reserved)</example>
661
662    <p/>
663    The VM will start the agent by calling this function.
664    It will be called in the context of a thread
665    that is attached to the VM. The first argument <i>&lt;vm&gt;</i> is the Java VM.
666    The <i>&lt;options&gt;</i> argument is the startup options provided to the agent.
667    <i>&lt;options&gt;</i> is encoded as a <internallink id="mUTF">modified UTF-8
668    </internallink> string.
669    If startup options were not provided, a zero length string is passed to
670    <code>options</code>. The lifespan of the <code>options</code> string is the
671    <code>Agent_OnAttach</code> or <code>Agent_OnAttach_&lt;agent-lib-name&gt;</code> call.
672    If needed beyond this time the string or parts of the string must be copied.
673    <p/>
674    Note that some <internallink id="capability">capabilities</internallink>
675    may not be available in the live phase.
676    <p/>
677    The <code>Agent_OnAttach</code> or <code>Agent_OnAttach_&lt;agent-lib-name
678    &gt;</code> function initializes the agent and returns a value
679    to the VM to indicate if an error occurred. Any value other than zero indicates an error.
680    An error does not cause the VM to terminate. Instead the VM ignores the error, or takes
681    some implementation specific action -- for example it might print an error to standard error,
682    or record the error in a system log.
683  </intro>
684
685  <intro id="onunload" label="Agent Shutdown">
686    The library may optionally export a
687    shutdown function with the following prototype:
688    <example>
689JNIEXPORT void JNICALL
690Agent_OnUnload(JavaVM *vm)</example>
691    Or for a statically linked agent named 'L':
692    <example>
693JNIEXPORT void JNICALL
694Agent_OnUnload_L(JavaVM *vm)</example>
695
696    This function will be called by the VM when the library is about to be unloaded.
697    The library will be unloaded (unless it is statically linked into the
698    executable) and this function will be called if some platform specific
699    mechanism causes the unload (an unload mechanism is not specified in this document)
700    or the library is (in effect) unloaded by the termination of the VM whether through
701    normal termination or VM failure, including start-up failure.
702    Uncontrolled shutdown is, of course, an exception to this rule.
703    Note the distinction between this function and the
704    <eventlink id="VMDeath">VM Death event</eventlink>: for the VM Death event
705    to be sent, the VM must have run at least to the point of initialization and a valid
706    <jvmti/> environment must exist which has set a callback for VMDeath
707    and enabled the event.
708    None of these are required for <code>Agent_OnUnload</code> or
709    <code>Agent_OnUnload_&lt;agent-lib-name&gt;</code> and this function
710    is also called if the library is unloaded for other reasons.
711    In the case that a VM Death event is sent, it will be sent before this
712    function is called (assuming this function is called due to VM termination).
713    This function can be used to clean-up resources allocated by the agent.
714  </intro>
715
716  <intro id="tooloptions" label="JAVA_TOOL_OPTIONS">
717    Since the command-line cannot always be accessed or modified, for example in embedded VMs
718    or simply VMs launched deep within scripts, a <code>JAVA_TOOL_OPTIONS</code> variable is
719    provided so that agents may be launched in these cases.
720    <p/>
721    Platforms which support environment variables or other named strings, may support the
722    <code>JAVA_TOOL_OPTIONS</code> variable.  This variable will be broken into options at white-space
723    boundaries.  White-space characters include space, tab, carriage-return, new-line,
724    vertical-tab, and form-feed.  Sequences of white-space characters are considered
725    equivalent to a single white-space character.  No white-space is included in the options
726    unless quoted.  Quoting is as follows:
727    <ul>
728        <li>All characters enclosed between a pair of single quote marks (''), except a single
729        quote, are quoted.</li>
730        <li>Double quote characters have no special meaning inside a pair of single quote marks.</li>
731        <li>All characters enclosed between a pair of double quote marks (""), except a double
732        quote, are quoted.</li>
733        <li>Single quote characters have no special meaning inside a pair of double quote marks.</li>
734        <li>A quoted part can start or end anywhere in the variable.</li>
735        <li>White-space characters have no special meaning when quoted -- they are included in
736        the option like any other character and do not mark white-space boundaries.</li>
737        <li>The pair of quote marks is not included in the option.</li>
738    </ul>
739    <code>JNI_CreateJavaVM</code> (in the JNI Invocation API) will prepend these options to the options supplied
740    in its <code>JavaVMInitArgs</code> argument. Platforms may disable this feature in cases where security is
741    a concern; for example, the Reference Implementation disables this feature on Unix systems when
742    the effective user or group ID differs from the real ID.
743    This feature is intended to support the initialization of tools -- specifically including the
744    launching of native or Java programming language agents.  Multiple tools may wish to use this
745    feature, so the variable should not be overwritten, instead,  options should be appended to
746    the variable.  Note that since the variable is processed at the time of the JNI Invocation
747    API create VM call, options processed by a launcher (e.g., VM selection options) will not be handled.
748  </intro>
749
750  <intro id="environments" label="Environments">
751    The <jvmti/> specification supports the use of multiple simultaneous
752    <jvmti/> agents.
753    Each agent has its own <jvmti/> environment.
754    That is, the <jvmti/> state is
755    separate for each agent - changes to one environment do not affect the
756    others.  The state of a <jvmti/>
757    environment includes:
758    <ul>
759      <li><functionlink id="SetEventCallbacks">the event callbacks</functionlink></li>
760      <li><functionlink id="SetEventNotificationMode">the set of events which are enabled</functionlink></li>
761      <li><internallink id="capability">the capabilities</internallink></li>
762      <li><internallink id="memory">the memory allocation/deallocation hooks</internallink></li>
763    </ul>
764    Although their <jvmti/> state
765    is separate, agents inspect and modify the shared state
766    of the VM, they also share the native environment in which they execute.
767    As such, an agent can perturb the results of other agents or cause them
768    to fail.  It is the responsibility of the agent writer to specify the level
769    of compatibility with other agents.  <jvmti/> implementations are not capable
770    of preventing destructive interactions between agents. Techniques to reduce
771    the likelihood of these occurrences are beyond the scope of this document.
772    <p/>
773    An agent creates a <jvmti/> environment
774    by passing a <jvmti/> version
775    as the interface ID to the JNI Invocation API function
776    <externallink id="jni/invocation.html#getenv">
777      <code>GetEnv</code></externallink>.
778    See <internallink id="jvmtiEnvAccess">Accessing <jvmti/> Functions</internallink>
779    for more details on the creation and use of
780    <jvmti/> environments.
781    Typically, <jvmti/> environments are created by calling <code>GetEnv</code> from
782    <internallink id="onload"><code>Agent_OnLoad</code></internallink>.
783  </intro>
784
785  <intro id="bci" label="Bytecode Instrumentation">
786    This interface does not include some events that one might expect in an interface with
787    profiling support.  Some examples include full speed
788    method enter and exit events.  The interface instead provides support for
789    <i>bytecode instrumentation</i>, the ability to alter the Java virtual machine
790    bytecode instructions which comprise the target program.  Typically, these alterations
791    are to add "events" to the code of a method - for example, to add, at the beginning of a method,
792    a call to <code>MyProfiler.methodEntered()</code>.
793    Since the changes are purely additive, they do not modify application
794    state or behavior.
795    Because the inserted agent code is standard bytecodes, the VM can run at full speed,
796    optimizing not only the target program but also the instrumentation.  If the
797    instrumentation does not involve switching from bytecode execution, no expensive
798    state transitions are needed.  The result is high performance events.
799    This approach also provides complete control to the agent: instrumentation can be
800    restricted to "interesting" portions of the code (e.g., the end user's code) and
801    can be conditional.  Instrumentation can run entirely in Java programming language
802    code or can call into the native agent.  Instrumentation can simply maintain
803    counters or can statistically sample events.
804    <p/>
805    Instrumentation can be inserted in one of three ways:
806    <ul>
807      <li>
808	Static Instrumentation: The class file is instrumented before it
809	is loaded into the VM - for example, by creating a duplicate directory of
810	<code>*.class</code> files which have been modified to add the instrumentation.
811	This method is extremely awkward and, in general, an agent cannot know
812	the origin of the class files which will be loaded.
813      </li>
814      <li>
815	Load-Time Instrumentation: When a class file is loaded by the VM, the raw
816	bytes of the class file are sent for instrumentation to the agent.
817	The <eventlink id="ClassFileLoadHook"/>
818	event, triggered by the class load,
819	provides this functionality.  This mechanism provides efficient
820	and complete access to one-time instrumentation.
821      </li>
822      <li>
823	Dynamic Instrumentation: A class which is already loaded (and possibly
824	even running) is modified.  This optional feature is provided by the
825	<eventlink id="ClassFileLoadHook"/> event, triggered by calling the
826	<functionlink id="RetransformClasses"/> function.
827	Classes can be modified multiple times and can be returned to their
828	original state.
829	The mechanism allows instrumentation which changes during the
830	course of execution.
831      </li>
832    </ul>
833    <p/>
834    The class modification functionality provided in this interface
835    is intended to provide a mechanism for instrumentation
836    (the <eventlink id="ClassFileLoadHook"/> event
837    and the <functionlink id="RetransformClasses"/> function)
838    and, during development, for fix-and-continue debugging
839    (the <functionlink id="RedefineClasses"/> function).
840    <p/>
841    Care must be taken to avoid perturbing dependencies, especially when
842    instrumenting core classes.  For example, an approach to getting notification
843    of every object allocation is to instrument the constructor on
844    <code>Object</code>.  Assuming that the constructor is initially
845    empty, the constructor could be changed to:
846    <example>
847      public Object() {
848        MyProfiler.allocationTracker(this);
849      }
850    </example>
851    However, if this change was made using the
852    <eventlink id="ClassFileLoadHook"/>
853    event then this might impact a typical VM as follows:
854    the first created object will call the constructor causing a class load of
855    <code>MyProfiler</code>; which will then cause
856    object creation, and since <code>MyProfiler</code> isn't loaded yet,
857    infinite recursion; resulting in a stack overflow.  A refinement of this
858    would be to delay invoking the tracking method until a safe time.  For
859    example, <code>trackAllocations</code> could be set in the
860    handler for the <code>VMInit</code> event.
861    <example>
862      static boolean trackAllocations = false;
863
864      public Object() {
865        if (trackAllocations) {
866          MyProfiler.allocationTracker(this);
867        }
868      }
869    </example>
870    <p/>
871    The <functionlink id="SetNativeMethodPrefix"/> allows native methods
872    to be instrumented by the use of wrapper methods.
873  </intro>
874
875<intro id="bcimodules" label="Bytecode Instrumentation of code in modules">
876  Agents can use the functions <functionlink id="AddModuleReads"/>,
877  <functionlink id="AddModuleExports"/>, <functionlink id="AddModuleOpens"/>,
878  <functionlink id="AddModuleUses"/> and <functionlink id="AddModuleProvides"/>
879  to update a module to expand the set of modules that it reads, the set of
880  packages that it exports or opens to other modules, or the services that it
881  uses and provides.
882  <p/>
883  As an aid to agents that deploy supporting classes on the search path of
884  the bootstrap class loader, or the search path of the class loader that
885  loads the main class, the Java virtual machine arranges for the module
886  of classes transformed by the <eventlink id="ClassFileLoadHook"/> event to
887  read the unnamed module of both class loaders.
888</intro>
889
890  <intro id="mUTF" label="Modified UTF-8 String Encoding">
891    <jvmti/> uses modified UTF-8 to encode character strings.
892    This is the same encoding used by JNI.
893    Modified UTF-8 differs
894    from standard UTF-8 in the representation of supplementary characters
895    and of the null character. See the
896    <externallink id="jni/types.html#modified-utf-8-strings">
897      Modified UTF-8 Strings</externallink>
898    section of the JNI specification for details.
899  </intro>
900
901  <intro id="context" label="Specification Context">
902    Since this interface provides access to the state of applications running in the
903    Java virtual machine;
904    terminology refers to the Java platform and not the native
905    platform (unless stated otherwise).  For example:
906    <ul>
907      <li>"thread" means Java programming language thread.</li>
908      <li>"stack frame" means Java virtual machine stack frame.</li>
909      <li>"class" means Java programming language class.</li>
910      <li>"heap" means Java virtual machine heap.</li>
911      <li>"monitor" means Java programming language object monitor.</li>
912    </ul>
913    <p/>
914    Sun, Sun Microsystems, the Sun logo, Java, and JVM
915    are trademarks or registered trademarks of Oracle
916    and/or its affiliates, in the U.S. and other countries.
917  </intro>
918
919
920<functionsection label="Functions">
921  <intro id="jvmtiEnvAccess" label="Accessing Functions">
922    Native code accesses <jvmti/> features
923    by calling <jvmti/> functions.
924    Access to <jvmti/> functions is by use of an interface pointer
925    in the same manner as
926    <externallink id="jni/design.html">Java
927      Native Interface (JNI) functions</externallink> are accessed.
928    The <jvmti/> interface pointer is called the
929    <i>environment pointer</i>.
930    <p/>
931    An environment pointer is a pointer to an environment and has
932    the type <code>jvmtiEnv*</code>.
933    An environment has information about its <jvmti/> connection.
934    The first value in the environment is a pointer to the function table.
935    The function table is an array of pointers to <jvmti/> functions.
936    Every function pointer is at a predefined offset inside the
937    array.
938    <p/>
939    When used from the C language:
940    double indirection is used to access the functions;
941    the environment pointer provides context and is the first
942    parameter of each function call; for example:
943    <example>
944jvmtiEnv *jvmti;
945...
946jvmtiError err = (*jvmti)->GetLoadedClasses(jvmti, &amp;class_count, &amp;classes);
947    </example>
948    <p/>
949    When used from the C++ language:
950    functions are accessed as member functions of <code>jvmtiEnv</code>;
951    the environment pointer is not passed to the function call; for example:
952    <example>
953jvmtiEnv *jvmti;
954...
955jvmtiError err = jvmti->GetLoadedClasses(&amp;class_count, &amp;classes);
956    </example>
957    Unless otherwise stated, all examples and declarations in this
958    specification use the C language.
959    <p/>
960    A <jvmti/> environment can be obtained through the JNI Invocation API
961    <code>GetEnv</code> function:
962    <example>
963jvmtiEnv *jvmti;
964...
965(*jvm)->GetEnv(jvm, &amp;jvmti, JVMTI_VERSION_1_0);
966    </example>
967    Each call to <code>GetEnv</code>
968    creates a new <jvmti/> connection and thus
969    a new <jvmti/> environment.
970    The <code>version</code> argument of <code>GetEnv</code> must be
971    a <jvmti/> version.
972    The returned environment may have a different version than the
973    requested version but the returned environment must be compatible.
974    <code>GetEnv</code> will return <code>JNI_EVERSION</code> if a
975    compatible version is not available, if <jvmti/> is not supported or
976    <jvmti/> is not supported in the current VM configuration.
977    Other interfaces may be added for creating <jvmti/> environments
978    in specific contexts.
979    Each environment has its own state (for example,
980    <functionlink id="SetEventNotificationMode">desired events</functionlink>,
981    <functionlink id="SetEventCallbacks">event handling functions</functionlink>, and
982    <functionlink id="AddCapabilities">capabilities</functionlink>).
983    An environment is released with
984    <functionlink id="DisposeEnvironment"></functionlink>.
985    Thus, unlike JNI which has one environment per thread, <jvmti/> environments work
986    across threads and are created dynamically.
987  </intro>
988
989  <intro id="functionReturn" label="Function Return Values">
990    <jvmti/> functions always return an
991    <internallink id="ErrorSection">error code</internallink> via the
992    <datalink id="jvmtiError"/> function return value.
993    Some functions can return additional
994    values through pointers provided by the calling function.
995    In some cases, <jvmti/> functions allocate memory that your program must
996    explicitly deallocate. This is indicated in the individual <jvmti/>
997    function descriptions.  Empty lists, arrays, sequences, etc are
998    returned as <code>NULL</code>.
999    <p/>
1000    In the event that the <jvmti/> function encounters
1001    an error (any return value other than <code>JVMTI_ERROR_NONE</code>) the values
1002    of memory referenced by argument pointers is undefined, but no memory
1003    will have been allocated and no global references will have been allocated.
1004    If the error occurs because of invalid input, no action will have occurred.
1005  </intro>
1006
1007<intro id="refs" label="Managing JNI Object References">
1008    <jvmti/> functions identify objects with JNI references
1009    (<datalink id="jobject"/> and <datalink id="jclass"/>)
1010    and their derivatives
1011    (<datalink id="jthread"/> and <datalink id="jthreadGroup"/>).
1012    References passed to
1013    <jvmti/> functions can be either global or local, but they must be
1014    strong references. All references returned by <jvmti/> functions are
1015    local references--these local references are created
1016    during the <jvmti/> call.
1017    Local references are a resource that must be managed (see the
1018    <externallink id="jni/functions.html#local-references">
1019      JNI Documentation</externallink>).
1020    When threads return from native code all local references
1021    are freed.  Note that some threads, including typical
1022    agent threads, will never return from native code.
1023    A thread is ensured the ability to create sixteen local
1024    references without the need for any explicit management.
1025    For threads executing a limited number of <jvmti/> calls before
1026    returning from native code
1027    (for example, threads processing events),
1028    it may be determined that no explicit management
1029    is needed.
1030    However, long running agent threads will need explicit
1031    local reference management--usually with the JNI functions
1032    <code>PushLocalFrame</code> and <code>PopLocalFrame</code>.
1033    Conversely, to preserve references beyond the
1034    return from native code, they must be converted to global references.
1035    These rules do not apply to <datalink id="jmethodID"/> and <datalink id="jfieldID"/>
1036    as they are not <datalink id="jobject"/>s.
1037</intro>
1038
1039    <intro id="prereqState" label="Prerequisite State for Calling Functions">
1040      Unless the function explicitly states that the agent must bring
1041      a thread or the VM to a particular state (for example, suspended),
1042      the <jvmti/> implementation is responsible for bringing the VM to a
1043      safe and consistent state for performing the function.
1044    </intro>
1045
1046    <intro id="functionsExceptions" label="Exceptions and Functions">
1047      <jvmti/> functions never throw exceptions; error conditions are
1048      communicated via the
1049      <internallink id="functionReturn">function return value</internallink>.
1050      Any existing exception state is preserved across a call to a
1051      <jvmti/> function.
1052      See the
1053      <externallink
1054        id="jni/design.html#java-exceptions"
1055             >Java Exceptions</externallink>
1056      section of the JNI specification for information on handling exceptions.
1057    </intro>
1058
1059  <category id="memory" label="Memory Management">
1060    <intro>
1061      These functions provide for the allocation and deallocation of
1062      memory used by <jvmti/> functionality and can be used to provide
1063      working memory for agents.
1064      Memory managed by <jvmti/> is not compatible with other memory
1065      allocation libraries and mechanisms.
1066    </intro>
1067
1068    <function id="Allocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="46">
1069      <synopsis>Allocate</synopsis>
1070      <description>
1071	Allocate an area of memory through the <jvmti/> allocator.
1072        The allocated
1073	memory should be freed with <functionlink id="Deallocate"></functionlink>.
1074      </description>
1075      <origin>jvmdi</origin>
1076      <capabilities>
1077      </capabilities>
1078      <parameters>
1079	<param id="size">
1080	  <jlong/>
1081	  <description>
1082	    The number of bytes to allocate.
1083	    <rationale>
1084	      <code>jlong</code> is used for compatibility with JVMDI.
1085	    </rationale>
1086	  </description>
1087	</param>
1088	<param id="mem_ptr">
1089	  <allocbuf incount="size"><uchar/></allocbuf>
1090	  <description>
1091	    On return, a pointer to the beginning of the allocated memory.
1092            If <code>size</code> is zero, <code>NULL</code> is returned.
1093	  </description>
1094	</param>
1095      </parameters>
1096      <errors>
1097	<error id="JVMTI_ERROR_OUT_OF_MEMORY">
1098	  Memory request cannot be honored.
1099	</error>
1100	<error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
1101	  <paramlink id="size"></paramlink> is less than zero.
1102	</error>
1103      </errors>
1104    </function>
1105
1106    <function id="Deallocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="47">
1107      <synopsis>Deallocate</synopsis>
1108      <description>
1109	Deallocate <code>mem</code>  using the <jvmti/> allocator.
1110        This function should
1111	be used to deallocate any memory allocated and returned
1112        by a <jvmti/> function
1113	(including memory allocated with <functionlink id="Allocate"></functionlink>).
1114        All allocated memory must be deallocated
1115        or the memory cannot be reclaimed.
1116      </description>
1117      <origin>jvmdi</origin>
1118      <capabilities>
1119      </capabilities>
1120      <parameters>
1121	<param id="mem">
1122	  <outbuf>
1123            <uchar/>
1124	    <nullok>the call is ignored</nullok>
1125          </outbuf>
1126	  <description>
1127	    A pointer to the beginning of the allocated memory.
1128            Please ignore "On return, the elements are set."
1129              <todo>keep it from generating "On return, the elements are set"</todo>
1130	  </description>
1131	</param>
1132      </parameters>
1133      <errors>
1134      </errors>
1135    </function>
1136  </category>
1137
1138  <category id="threadCategory" label="Thread">
1139    <intro>
1140    </intro>
1141
1142    <function id="GetThreadState" num="17">
1143      <synopsis>Get Thread State</synopsis>
1144      <description>
1145        Get the state of a thread.  The state of the thread is represented by the
1146        answers to the hierarchical set of questions below:
1147          <ul type="circle">
1148            <li><i>Alive?</i>
1149              <ul>
1150                <li>Not alive.
1151                  <ul type="circle">
1152                    <li><i>Why not alive?</i>
1153                      <ul>
1154                        <li>New.</li>
1155                        <li>Terminated (<datalink
1156                            id="JVMTI_THREAD_STATE_TERMINATED"><code>JVMTI_THREAD_STATE_TERMINATED</code></datalink>)</li>
1157                      </ul>
1158                    </li>
1159                  </ul>
1160                </li>
1161                <li>Alive (<datalink
1162                    id="JVMTI_THREAD_STATE_ALIVE"><code>JVMTI_THREAD_STATE_ALIVE</code></datalink>)
1163                  <ul type="circle">
1164                    <li><i>Suspended?</i>
1165                      <ul>
1166                        <li>Suspended (<datalink
1167                            id="JVMTI_THREAD_STATE_SUSPENDED"><code>JVMTI_THREAD_STATE_SUSPENDED</code></datalink>)</li>
1168                        <li>Not suspended</li>
1169                      </ul>
1170                    </li>
1171                    <li><i>Interrupted?</i>
1172                      <ul>
1173                        <li>Interrupted (<datalink
1174                            id="JVMTI_THREAD_STATE_INTERRUPTED"><code>JVMTI_THREAD_STATE_INTERRUPTED</code></datalink>)</li>
1175                        <li>Not interrupted.</li>
1176                      </ul>
1177                    </li>
1178                    <li><i>In native?</i>
1179                      <ul>
1180                        <li>In native code (<datalink
1181                            id="JVMTI_THREAD_STATE_IN_NATIVE"><code>JVMTI_THREAD_STATE_IN_NATIVE</code></datalink>)</li>
1182                        <li>In Java programming language code</li>
1183                      </ul>
1184                    </li>
1185                    <li><i>What alive state?</i>
1186                      <ul>
1187                        <li>Runnable (<datalink
1188                            id="JVMTI_THREAD_STATE_RUNNABLE"><code>JVMTI_THREAD_STATE_RUNNABLE</code></datalink>)</li>
1189                        <li>Blocked (<datalink
1190                            id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER"><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></datalink>)</li>
1191                        <li>Waiting (<datalink
1192                            id="JVMTI_THREAD_STATE_WAITING"><code>JVMTI_THREAD_STATE_WAITING</code></datalink>)
1193                          <ul type="circle">
1194                            <li><i>Timed wait?</i>
1195                              <ul>
1196                                <li>Indefinite (<datalink
1197                                    id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY"><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></datalink></li>
1198                                <li>Timed (<datalink
1199                                    id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT"><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></datalink>)</li>
1200                              </ul>
1201                            </li>
1202                            <li><i>Why waiting?</i>
1203                              <ul>
1204                                <li>Object.wait (<datalink
1205                                    id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT"><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></datalink>)</li>
1206                                <li>LockSupport.park (<datalink
1207                                    id="JVMTI_THREAD_STATE_PARKED"><code>JVMTI_THREAD_STATE_PARKED</code></datalink>)</li>
1208                                <li>Sleeping (<datalink
1209                                    id="JVMTI_THREAD_STATE_SLEEPING"><code>JVMTI_THREAD_STATE_SLEEPING</code></datalink>)</li>
1210                              </ul>
1211                            </li>
1212                          </ul>
1213                        </li>
1214                      </ul>
1215                    </li>
1216                  </ul>
1217                </li>
1218              </ul>
1219            </li>
1220          </ul>
1221        <p/>
1222	The answers are represented by the following bit vector.
1223	<constants id="jvmtiThreadState" label="Thread State Flags" kind="bits">
1224	  <constant id="JVMTI_THREAD_STATE_ALIVE" num="0x0001">
1225	    Thread is alive. Zero if thread is new (not started) or terminated.
1226	  </constant>
1227	  <constant id="JVMTI_THREAD_STATE_TERMINATED" num="0x0002">
1228	    Thread has completed execution.
1229	  </constant>
1230	  <constant id="JVMTI_THREAD_STATE_RUNNABLE" num="0x0004">
1231	    Thread is runnable.
1232	  </constant>
1233	  <constant id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER" num="0x0400">
1234	    Thread is waiting to enter a synchronization block/method or,
1235            after an <code>Object.wait()</code>, waiting to re-enter a
1236            synchronization block/method.
1237	  </constant>
1238	  <constant id="JVMTI_THREAD_STATE_WAITING" num="0x0080">
1239	    Thread is waiting.
1240	  </constant>
1241	  <constant id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY" num="0x0010">
1242	    Thread is waiting without a timeout.
1243            For example, <code>Object.wait()</code>.
1244	  </constant>
1245	  <constant id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT" num="0x0020">
1246	    Thread is waiting with a maximum time to wait specified.
1247            For example, <code>Object.wait(long)</code>.
1248	  </constant>
1249	  <constant id="JVMTI_THREAD_STATE_SLEEPING" num="0x0040">
1250	    Thread is sleeping -- <code>Thread.sleep(long)</code>.
1251	  </constant>
1252	  <constant id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT" num="0x0100">
1253	    Thread is waiting on an object monitor -- <code>Object.wait</code>.
1254	  </constant>
1255	  <constant id="JVMTI_THREAD_STATE_PARKED" num="0x0200">
1256	    Thread is parked, for example: <code>LockSupport.park</code>,
1257            <code>LockSupport.parkUtil</code> and <code>LockSupport.parkNanos</code>.
1258	  </constant>
1259	  <constant id="JVMTI_THREAD_STATE_SUSPENDED" num="0x100000">
1260	    Thread suspended.
1261	    <code>java.lang.Thread.suspend()</code>
1262	    or a <jvmti/> suspend function
1263            (such as <functionlink id="SuspendThread"></functionlink>)
1264            has been called on the thread. If this bit
1265	    is set, the other bits refer to the thread state before suspension.
1266	  </constant>
1267	  <constant id="JVMTI_THREAD_STATE_INTERRUPTED" num="0x200000">
1268	    Thread has been interrupted.
1269	  </constant>
1270	  <constant id="JVMTI_THREAD_STATE_IN_NATIVE" num="0x400000">
1271            Thread is in native code--that is, a native method is running
1272            which has not called back into the VM or Java programming
1273            language code.
1274            <p/>
1275            This flag is not set when running VM compiled Java programming
1276            language code nor is it set when running VM code or
1277            VM support code. Native VM interface functions, such as JNI and
1278            <jvmti/> functions, may be implemented as VM code.
1279	  </constant>
1280	  <constant id="JVMTI_THREAD_STATE_VENDOR_1" num="0x10000000">
1281            Defined by VM vendor.
1282	  </constant>
1283	  <constant id="JVMTI_THREAD_STATE_VENDOR_2" num="0x20000000">
1284            Defined by VM vendor.
1285	  </constant>
1286	  <constant id="JVMTI_THREAD_STATE_VENDOR_3" num="0x40000000">
1287            Defined by VM vendor.
1288	  </constant>
1289	</constants>
1290        The following definitions are used to convert <jvmti/> thread state
1291        to <code>java.lang.Thread.State</code> style states.
1292	<constants id="jvmtiJavaLangThreadState" label="java.lang.Thread.State Conversion Masks" kind="bits">
1293	  <constant id="JVMTI_JAVA_LANG_THREAD_STATE_MASK"
1294                     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">
1295	    Mask the state with this before comparison
1296	  </constant>
1297	  <constant id="JVMTI_JAVA_LANG_THREAD_STATE_NEW"
1298                     num="0">
1299	    <code>java.lang.Thread.State.NEW</code>
1300	  </constant>
1301	  <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED"
1302                     num="JVMTI_THREAD_STATE_TERMINATED">
1303	    <code>java.lang.Thread.State.TERMINATED</code>
1304	  </constant>
1305	  <constant id="JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE"
1306                     num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE">
1307	    <code>java.lang.Thread.State.RUNNABLE</code>
1308	  </constant>
1309	  <constant id="JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED"
1310                     num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER">
1311	    <code>java.lang.Thread.State.BLOCKED</code>
1312	  </constant>
1313	  <constant id="JVMTI_JAVA_LANG_THREAD_STATE_WAITING"
1314                     num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY">
1315	    <code>java.lang.Thread.State.WAITING</code>
1316	  </constant>
1317	  <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING"
1318                     num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT">
1319	    <code>java.lang.Thread.State.TIMED_WAITING</code>
1320	  </constant>
1321	</constants>
1322        <b>Rules</b>
1323        <p/>
1324        There can be no more than one answer to a question, although there can be no
1325        answer (because the answer is unknown, does not apply, or none of the answers is
1326        correct).  An answer is set only when the enclosing answers match.
1327        That is, no more than one of
1328          <ul type="circle">
1329              <li><code>JVMTI_THREAD_STATE_RUNNABLE</code></li>
1330              <li><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></li>
1331              <li><code>JVMTI_THREAD_STATE_WAITING</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_ALIVE</code> is set).
1335        And if any of these are set, the enclosing answer
1336        <code>JVMTI_THREAD_STATE_ALIVE</code> is set.
1337        No more than one of
1338          <ul type="circle">
1339              <li><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></li>
1340              <li><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></li>
1341          </ul>
1342        can be set (a <tm>J2SE</tm> compliant implementation will always set
1343        one of these if <code>JVMTI_THREAD_STATE_WAITING</code> is set).
1344        And if either is set, the enclosing answers
1345        <code>JVMTI_THREAD_STATE_ALIVE</code> and
1346        <code>JVMTI_THREAD_STATE_WAITING</code> are set.
1347        No more than one of
1348          <ul type="circle">
1349              <li><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></li>
1350              <li><code>JVMTI_THREAD_STATE_PARKED</code></li>
1351              <li><code>JVMTI_THREAD_STATE_SLEEPING</code></li>
1352          </ul>
1353        can be set. And if any of these is set, the enclosing answers
1354        <code>JVMTI_THREAD_STATE_ALIVE</code> and
1355        <code>JVMTI_THREAD_STATE_WAITING</code> are set.
1356        Also, if <code>JVMTI_THREAD_STATE_SLEEPING</code> is set,
1357        then <code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code> is set.
1358        If a state <i>A</i> is implemented using the mechanism of
1359        state <i>B</i> then it is state <i>A</i> which
1360        is returned by this function.
1361        For example, if <code>Thread.sleep(long)</code>
1362        is implemented using <code>Object.wait(long)</code>
1363        then it is still <code>JVMTI_THREAD_STATE_SLEEPING</code>
1364        which is returned.
1365        More than one of
1366          <ul type="circle">
1367              <li><code>JVMTI_THREAD_STATE_SUSPENDED</code></li>
1368              <li><code>JVMTI_THREAD_STATE_INTERRUPTED</code></li>
1369              <li><code>JVMTI_THREAD_STATE_IN_NATIVE</code></li>
1370          </ul>
1371        can be set, but if any is set,
1372        <code>JVMTI_THREAD_STATE_ALIVE</code> is set.
1373        <p/>
1374        And finally,
1375        <code>JVMTI_THREAD_STATE_TERMINATED</code> cannot be set unless
1376        <code>JVMTI_THREAD_STATE_ALIVE</code> is not set.
1377        <p/>
1378        The thread state representation is designed for extension in future versions
1379        of the specification; thread state values should be used accordingly, that is
1380        they should not be used as ordinals.
1381        Most queries can be made by testing a single bit, if use in a switch statement is desired,
1382        the state bits should be masked with the interesting bits.
1383        All bits not defined above are reserved for future use.
1384        A VM, compliant to the current specification, must set reserved bits to zero.
1385        An agent should ignore reserved bits --
1386        they should not be assumed to be zero and thus should not be included in comparisons.
1387        <p/>
1388        <b>Examples</b>
1389        <p/>
1390        Note that the values below exclude reserved and vendor bits.
1391        <p/>
1392        The state of a thread blocked at a <code>synchronized</code>-statement would be:
1393        <example>
1394            JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER
1395        </example>
1396        The state of a thread which hasn't started yet would be:
1397        <example>
1398            0
1399        </example>
1400        The state of a thread at a <code>Object.wait(3000)</code> would be:
1401        <example>
1402            JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_WAITING +
1403                JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
1404                JVMTI_THREAD_STATE_MONITOR_WAITING
1405        </example>
1406        The state of a thread suspended while runnable would be:
1407        <example>
1408            JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_RUNNABLE + JVMTI_THREAD_STATE_SUSPENDED
1409        </example>
1410        <p/>
1411        <b>Testing the State</b>
1412        <p/>
1413        In most cases, the thread state can be determined by testing the one bit corresponding
1414        to that question.  For example, the code to test if a thread is sleeping:
1415        <example>
1416	jint state;
1417	jvmtiError err;
1418
1419	err = (*jvmti)-&gt;GetThreadState(jvmti, thread, &amp;state);
1420	if (err == JVMTI_ERROR_NONE) {
1421	   if (state &amp; JVMTI_THREAD_STATE_SLEEPING) {  ...
1422        </example>
1423        <p/>
1424        For waiting (that is, in <code>Object.wait</code>, parked, or sleeping) it would be:
1425        <example>
1426	   if (state &amp; JVMTI_THREAD_STATE_WAITING) {  ...
1427        </example>
1428        For some states, more than one bit will need to be tested as is the case
1429        when testing if a thread has not yet been started:
1430        <example>
1431	   if ((state &amp; (JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_TERMINATED)) == 0)  {  ...
1432        </example>
1433        To distinguish timed from untimed <code>Object.wait</code>:
1434        <example>
1435	   if (state &amp; JVMTI_THREAD_STATE_IN_OBJECT_WAIT)  {
1436             if (state &amp; JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT)  {
1437               printf("in Object.wait(long timeout)\n");
1438             } else {
1439               printf("in Object.wait()\n");
1440             }
1441           }
1442        </example>
1443        <p/>
1444        <b>Relationship to <code>java.lang.Thread.State</code></b>
1445        <p/>
1446        The thread state represented by <code>java.lang.Thread.State</code>
1447        returned from <code>java.lang.Thread.getState()</code> is a subset of the
1448        information returned from this function.
1449        The corresponding <code>java.lang.Thread.State</code> can be determined
1450        by using the provided conversion masks.
1451        For example, this returns the name of the <code>java.lang.Thread.State</code> thread state:
1452        <example>
1453	    err = (*jvmti)-&gt;GetThreadState(jvmti, thread, &amp;state);
1454	    abortOnError(err);
1455            switch (state &amp; JVMTI_JAVA_LANG_THREAD_STATE_MASK) {
1456            case JVMTI_JAVA_LANG_THREAD_STATE_NEW:
1457              return "NEW";
1458            case JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED:
1459              return "TERMINATED";
1460            case JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE:
1461              return "RUNNABLE";
1462            case JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED:
1463              return "BLOCKED";
1464            case JVMTI_JAVA_LANG_THREAD_STATE_WAITING:
1465              return "WAITING";
1466            case JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING:
1467              return "TIMED_WAITING";
1468            }
1469        </example>
1470      </description>
1471      <origin>new</origin>
1472      <capabilities>
1473      </capabilities>
1474      <parameters>
1475	<param id="thread">
1476	  <jthread null="current" started="maybe" impl="noconvert"/>
1477	    <description>
1478	      The thread to query.
1479	    </description>
1480	</param>
1481	<param id="thread_state_ptr">
1482	  <outptr><jint/></outptr>
1483	  <description>
1484	    On return, points to state flags,
1485	    as defined by the <internallink id="jvmtiThreadState">Thread State Flags</internallink>.
1486	  </description>
1487	</param>
1488      </parameters>
1489      <errors>
1490      </errors>
1491    </function>
1492
1493    <function id="GetCurrentThread" phase="start" num="18" since="1.1">
1494      <synopsis>Get Current Thread</synopsis>
1495      <description>
1496        Get the current thread.
1497        The current thread is the Java programming language thread which has called the function.
1498        The function may return <code>NULL</code> in the start phase if the
1499        <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
1500        <code>can_generate_early_vmstart</code></internallink> capability is enabled
1501        and the <code>java.lang.Thread</code> class has not been initialized yet.
1502        <p/>
1503        Note that most <jvmti/> functions that take a thread
1504        as an argument will accept <code>NULL</code> to mean
1505        the current thread.
1506      </description>
1507      <origin>new</origin>
1508      <capabilities>
1509      </capabilities>
1510      <parameters>
1511        <param id="thread_ptr">
1512	  <outptr><jthread/></outptr>
1513	  <description>
1514	     On return, points to the current thread, or <code>NULL</code>.
1515	  </description>
1516	</param>
1517      </parameters>
1518      <errors>
1519      </errors>
1520    </function>
1521
1522    <function id="GetAllThreads" num="4">
1523      <synopsis>Get All Threads</synopsis>
1524      <description>
1525        Get all live threads.
1526        The threads are Java programming language threads;
1527        that is, threads that are attached to the VM.
1528        A thread is live if <code>java.lang.Thread.isAlive()</code>
1529        would return <code>true</code>, that is, the thread has
1530        been started and has not yet died.
1531        The universe of threads is determined by the context of the <jvmti/>
1532        environment, which typically is all threads attached to the VM.
1533        Note that this includes <jvmti/> agent threads
1534        (see <functionlink id="RunAgentThread"/>).
1535      </description>
1536      <origin>jvmdi</origin>
1537      <capabilities>
1538      </capabilities>
1539      <parameters>
1540        <param id="threads_count_ptr">
1541	  <outptr><jint/></outptr>
1542	  <description>
1543	    On return, points to the number of running threads.
1544	  </description>
1545	</param>
1546        <param id="threads_ptr">
1547	  <allocbuf outcount="threads_count_ptr"><jthread/></allocbuf>
1548	    <description>
1549	      On return, points to an array of references, one
1550	      for each running thread.
1551	    </description>
1552	</param>
1553      </parameters>
1554      <errors>
1555      </errors>
1556    </function>
1557
1558    <function id="SuspendThread" num="5">
1559      <synopsis>Suspend Thread</synopsis>
1560      <description>
1561        Suspend the specified thread. If the calling thread is specified,
1562        this function will not return until some other thread calls
1563        <functionlink id="ResumeThread"></functionlink>.
1564        If the thread is currently suspended, this function
1565        does nothing and returns an error.
1566      </description>
1567      <origin>jvmdi</origin>
1568      <capabilities>
1569        <required id="can_suspend"></required>
1570      </capabilities>
1571      <parameters>
1572        <param id="thread">
1573	  <jthread null="current"/>
1574	    <description>
1575	      The thread to suspend.
1576	    </description>
1577	</param>
1578      </parameters>
1579      <errors>
1580        <error id="JVMTI_ERROR_THREAD_SUSPENDED">
1581          Thread already suspended.
1582        </error>
1583      </errors>
1584    </function>
1585
1586    <elide>
1587    <function id="SuspendAllThreads" num="101">
1588      <synopsis>Suspend All Threads</synopsis>
1589      <description>
1590	<issue>
1591	    There has been no explicit call for this function, and it will
1592	    thus be removed if there is no interest.
1593        </issue>
1594        Suspend all live threads except:
1595        <ul>
1596          <li>already suspended threads</li>
1597          <li>those listed in <paramlink id="except_list"></paramlink></li>
1598          <li>certain system (non application) threads, as determined
1599            by the VM implementation</li>
1600        </ul>
1601        The threads are Java programming language threads;
1602        native threads which are not attached to the VM are not
1603        Java programming language threads.
1604        A thread is live if <code>java.lang.Thread.isAlive()</code>
1605        would return <code>true</code>, that is, the thread has
1606        been started and has not yet died.
1607        The universe of threads is determined
1608        by the context of the <jvmti/>
1609        environment, which, typically, is all threads attached to the VM,
1610        except critical VM internal threads and <jvmti/> agent threads
1611	(see <functionlink id="RunAgentThread"/>).
1612        <p/>
1613        If the calling thread is specified,
1614        all other threads are suspended first then the caller thread is suspended -
1615        this function will not return until some other thread calls
1616        <functionlink id="ResumeThread"></functionlink>.
1617        <p/>
1618        The list of actually
1619        suspended threads is returned in
1620        <paramlink id="suspended_list_ptr"></paramlink>.
1621        Suspension is as defined in <functionlink id="SuspendThread"></functionlink>.
1622        <functionlink id="ResumeThreadList"></functionlink>
1623        can be used to resume the suspended threads.
1624      </description>
1625      <origin>new</origin>
1626      <capabilities>
1627        <required id="can_suspend"></required>
1628      </capabilities>
1629      <parameters>
1630        <param id="except_count">
1631	  <jint min="0"/>
1632	  <description>
1633	    The number of threads in the list of threads not to be suspended.
1634	  </description>
1635	</param>
1636        <param id="except_list">
1637            <inbuf incount="except_count">
1638              <jthread/>
1639              <nullok>not an error if <code>except_count == 0</code></nullok>
1640            </inbuf>
1641	    <description>
1642	      The list of threads not to be suspended.
1643	    </description>
1644	</param>
1645        <param id="suspended_count_ptr">
1646	  <outptr><jint/></outptr>
1647	  <description>
1648	    On return, points to the number of threads suspended by this call.
1649	  </description>
1650	</param>
1651        <param id="suspended_list_ptr">
1652	  <allocbuf outcount="suspended_count_ptr"><jthread/></allocbuf>
1653	    <description>
1654	      On return, points to an array of references, one
1655	      for each thread suspended.
1656	    </description>
1657	</param>
1658      </parameters>
1659      <errors>
1660        <error id="JVMTI_ERROR_INVALID_THREAD">
1661          A thread in <paramlink id="except_list"></paramlink> was invalid.
1662        </error>
1663        <error id="JVMTI_ERROR_NULL_POINTER">
1664          Both <paramlink id="except_list"></paramlink> was <code>NULL</code>
1665          and <paramlink id="except_count"></paramlink> was non-zero.
1666        </error>
1667      </errors>
1668    </function>
1669    </elide>
1670
1671    <function id="SuspendThreadList" num="92">
1672      <synopsis>Suspend Thread List</synopsis>
1673      <description>
1674        Suspend the <paramlink id="request_count"></paramlink>
1675        threads specified in the
1676        <paramlink id="request_list"></paramlink> array.
1677        Threads may be resumed with
1678        <functionlink id="ResumeThreadList"></functionlink> or
1679        <functionlink id="ResumeThread"></functionlink>.
1680        If the calling thread is specified in the
1681        <paramlink id="request_list"></paramlink> array, this function will
1682        not return until some other thread resumes it.
1683        Errors encountered in the suspension of a thread
1684        are returned in the <paramlink id="results"></paramlink>
1685        array, <b>not</b> in the return value of this function.
1686        Threads that are currently suspended do not change state.
1687      </description>
1688      <origin>jvmdi</origin>
1689      <capabilities>
1690        <required id="can_suspend"></required>
1691      </capabilities>
1692      <parameters>
1693        <param id="request_count">
1694	  <jint min="0"/>
1695	  <description>
1696	    The number of threads to suspend.
1697	  </description>
1698	</param>
1699        <param id="request_list">
1700	  <inbuf incount="request_count"><jthread/></inbuf>
1701	    <description>
1702	      The list of threads to suspend.
1703	    </description>
1704	</param>
1705        <param id="results">
1706	  <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf>
1707	  <description>
1708	    An agent supplied array of
1709	    <paramlink id="request_count"></paramlink> elements.
1710	    On return, filled with the error code for
1711	    the suspend of the corresponding thread.
1712	    The error code will be
1713	    <errorlink id="JVMTI_ERROR_NONE"></errorlink>
1714	    if the thread was suspended by this call.
1715	    Possible error codes are those specified
1716	    for <functionlink id="SuspendThread"></functionlink>.
1717	  </description>
1718	</param>
1719      </parameters>
1720      <errors>
1721      </errors>
1722    </function>
1723
1724    <function id="ResumeThread" num="6">
1725      <synopsis>Resume Thread</synopsis>
1726      <description>
1727        Resume a suspended thread.
1728        Any threads currently suspended through
1729        a <jvmti/> suspend function (eg.
1730        <functionlink id="SuspendThread"></functionlink>)
1731        or <code>java.lang.Thread.suspend()</code>
1732        will resume execution;
1733	all other threads are unaffected.
1734      </description>
1735      <origin>jvmdi</origin>
1736      <capabilities>
1737        <required id="can_suspend"></required>
1738      </capabilities>
1739      <parameters>
1740        <param id="thread">
1741	  <jthread/>
1742	    <description>
1743	      The thread to resume.
1744	    </description>
1745	</param>
1746      </parameters>
1747      <errors>
1748        <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
1749          Thread was not suspended.
1750        </error>
1751        <error id="JVMTI_ERROR_INVALID_TYPESTATE">
1752          The state of the thread has been modified, and is now inconsistent.
1753        </error>
1754      </errors>
1755    </function>
1756
1757    <function id="ResumeThreadList" num="93">
1758      <synopsis>Resume Thread List</synopsis>
1759      <description>
1760        Resume the <paramlink id="request_count"></paramlink>
1761        threads specified in the
1762        <paramlink id="request_list"></paramlink> array.
1763        Any thread suspended through
1764        a <jvmti/> suspend function (eg.
1765        <functionlink id="SuspendThreadList"></functionlink>)
1766        or <code>java.lang.Thread.suspend()</code>
1767        will resume execution.
1768      </description>
1769      <origin>jvmdi</origin>
1770      <capabilities>
1771        <required id="can_suspend"></required>
1772      </capabilities>
1773      <parameters>
1774        <param id="request_count">
1775	  <jint min="0"/>
1776	  <description>
1777	    The number of threads to resume.
1778	  </description>
1779	</param>
1780        <param id="request_list">
1781	  <inbuf incount="request_count"><jthread/></inbuf>
1782	    <description>
1783	      The threads to resume.
1784	    </description>
1785	</param>
1786        <param id="results">
1787	  <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf>
1788	  <description>
1789	    An agent supplied array of
1790	    <paramlink id="request_count"></paramlink> elements.
1791	    On return, filled with the error code for
1792	    the resume of the corresponding thread.
1793	    The error code will be
1794	    <errorlink id="JVMTI_ERROR_NONE"></errorlink>
1795	    if the thread was suspended by this call.
1796	    Possible error codes are those specified
1797	    for <functionlink id="ResumeThread"></functionlink>.
1798	  </description>
1799	</param>
1800      </parameters>
1801      <errors>
1802      </errors>
1803    </function>
1804
1805    <function id="StopThread" num="7">
1806      <synopsis>Stop Thread</synopsis>
1807      <description>
1808	Send the specified asynchronous exception to the specified thread.
1809	Normally, this function is used to kill the specified thread with an
1810	instance of the exception <code>ThreadDeath</code>, similar to
1811        <code>java.lang.Thread.stop</code>.
1812      </description>
1813      <origin>jvmdi</origin>
1814      <capabilities>
1815	<required id="can_signal_thread"></required>
1816      </capabilities>
1817      <parameters>
1818	<param id="thread">
1819	  <jthread/>
1820	    <description>
1821	      The thread to stop.
1822	    </description>
1823	</param>
1824	<param id="exception">
1825	  <jobject/>
1826	    <description>
1827	      The asynchronous exception object.
1828	    </description>
1829	</param>
1830      </parameters>
1831      <errors>
1832      </errors>
1833    </function>
1834
1835    <function id="InterruptThread" num="8">
1836      <synopsis>Interrupt Thread</synopsis>
1837      <description>
1838	Interrupt the specified thread
1839	(similar to <code>java.lang.Thread.interrupt</code>).
1840      </description>
1841      <origin>jvmdi</origin>
1842      <capabilities>
1843	<required id="can_signal_thread"></required>
1844      </capabilities>
1845      <parameters>
1846	<param id="thread">
1847	  <jthread impl="noconvert"/>
1848	    <description>
1849	      The thread to interrupt.
1850	    </description>
1851	</param>
1852      </parameters>
1853      <errors>
1854      </errors>
1855    </function>
1856
1857    <function id="GetThreadInfo" num="9">
1858      <synopsis>Get Thread Info</synopsis>
1859      <typedef id="jvmtiThreadInfo" label="Thread information structure">
1860	<field id="name">
1861	  <allocfieldbuf><char/></allocfieldbuf>
1862	  <description>
1863	    The thread name, encoded as a
1864	    <internallink id="mUTF">modified UTF-8</internallink> string.
1865	  </description>
1866	</field>
1867	<field id="priority">
1868	  <jint/>
1869	  <description>
1870	    The thread priority.  See the thread priority constants:
1871	    <datalink id="jvmtiThreadPriority"></datalink>.
1872	  </description>
1873	</field>
1874	<field id="is_daemon">
1875	  <jboolean/>
1876	  <description>
1877	    Is this a daemon thread?
1878	  </description>
1879	</field>
1880	<field id="thread_group">
1881	  <jthreadGroup/>
1882	  <description>
1883	    The thread group to which this thread belongs.
1884            <code>NULL</code> if the thread has died.
1885	  </description>
1886	</field>
1887	<field id="context_class_loader">
1888	  <jobject/>
1889	    <description>
1890	      The context class loader associated with this thread.
1891	    </description>
1892	</field>
1893      </typedef>
1894      <description>
1895	Get thread information. The fields of the <datalink id="jvmtiThreadInfo"/> structure
1896	are filled in with details of the specified thread.
1897      </description>
1898      <origin>jvmdi</origin>
1899      <capabilities>
1900      </capabilities>
1901      <parameters>
1902	<param id="thread">
1903	  <jthread null="current" impl="noconvert" started="maybe"/>
1904	    <description>
1905	      The thread to query.
1906	    </description>
1907	</param>
1908	<param id="info_ptr">
1909	  <outptr><struct>jvmtiThreadInfo</struct></outptr>
1910	  <description>
1911	    On return, filled with information describing the specified thread.
1912	  </description>
1913	</param>
1914      </parameters>
1915      <errors>
1916      </errors>
1917    </function>
1918
1919    <function id="GetOwnedMonitorInfo" num="10">
1920      <synopsis>Get Owned Monitor Info</synopsis>
1921      <description>
1922	Get information about the monitors owned by the
1923	specified thread.
1924      </description>
1925      <origin>jvmdiClone</origin>
1926      <capabilities>
1927	<required id="can_get_owned_monitor_info"></required>
1928      </capabilities>
1929      <parameters>
1930	<param id="thread">
1931	  <jthread null="current"/>
1932	    <description>
1933	      The thread to query.
1934	    </description>
1935	</param>
1936	<param id="owned_monitor_count_ptr">
1937	  <outptr><jint/></outptr>
1938	  <description>
1939	    The number of monitors returned.
1940	  </description>
1941	</param>
1942	<param id="owned_monitors_ptr">
1943	  <allocbuf outcount="owned_monitor_count_ptr"><jobject/></allocbuf>
1944	    <description>
1945	      The array of owned monitors.
1946	    </description>
1947	</param>
1948      </parameters>
1949      <errors>
1950      </errors>
1951    </function>
1952
1953    <function id="GetOwnedMonitorStackDepthInfo" num="153" since="1.1">
1954      <synopsis>Get Owned Monitor Stack Depth Info</synopsis>
1955      <typedef id="jvmtiMonitorStackDepthInfo"
1956               label="Monitor stack depth information structure">
1957        <field id="monitor">
1958	  <jobject/>
1959	    <description>
1960	      The owned monitor.
1961	    </description>
1962	</field>
1963        <field id="stack_depth">
1964	  <jint/>
1965	  <description>
1966	    The stack depth.  Corresponds to the stack depth used in the
1967            <internallink id="stack">Stack Frame functions</internallink>.
1968            That is, zero is the current frame, one is the frame which
1969            called the current frame. And it is negative one if the
1970	    implementation cannot determine the stack depth (e.g., for
1971	    monitors acquired by JNI <code>MonitorEnter</code>).
1972	  </description>
1973	</field>
1974      </typedef>
1975      <description>
1976	Get information about the monitors owned by the
1977	specified thread and the depth of the stack frame which locked them.
1978      </description>
1979      <origin>new</origin>
1980      <capabilities>
1981	<required id="can_get_owned_monitor_stack_depth_info"></required>
1982      </capabilities>
1983      <parameters>
1984	<param id="thread">
1985	  <jthread null="current"/>
1986	    <description>
1987	      The thread to query.
1988	    </description>
1989	</param>
1990	<param id="monitor_info_count_ptr">
1991	  <outptr><jint/></outptr>
1992	  <description>
1993	    The number of monitors returned.
1994	  </description>
1995	</param>
1996	<param id="monitor_info_ptr">
1997	  <allocbuf outcount="monitor_info_count_ptr">
1998            <struct>jvmtiMonitorStackDepthInfo</struct>
1999          </allocbuf>
2000	  <description>
2001	    The array of owned monitor depth information.
2002	  </description>
2003	</param>
2004      </parameters>
2005      <errors>
2006      </errors>
2007    </function>
2008
2009    <function id="GetCurrentContendedMonitor" num="11">
2010      <synopsis>Get Current Contended Monitor</synopsis>
2011      <description>
2012	Get the object, if any, whose monitor the specified thread is waiting to
2013	enter or waiting to regain through <code>java.lang.Object.wait</code>.
2014      </description>
2015      <origin>jvmdi</origin>
2016      <capabilities>
2017	<required id="can_get_current_contended_monitor"></required>
2018      </capabilities>
2019      <parameters>
2020	<param id="thread">
2021	  <jthread null="current"/>
2022	    <description>
2023	      The thread to query.
2024	    </description>
2025	</param>
2026	<param id="monitor_ptr">
2027	  <outptr><jobject/></outptr>
2028	    <description>
2029	      On return, filled with the current contended monitor, or
2030	      NULL if there is none.
2031	    </description>
2032	</param>
2033      </parameters>
2034      <errors>
2035      </errors>
2036    </function>
2037
2038    <callback id="jvmtiStartFunction">
2039      <void/>
2040      <synopsis>Agent Start Function</synopsis>
2041      <description>
2042        Agent supplied callback function.
2043        This function is the entry point for an agent thread
2044	started with
2045	<functionlink id="RunAgentThread"></functionlink>.
2046      </description>
2047      <parameters>
2048	  <param id="jvmti_env">
2049	    <outptr>
2050	      <struct>jvmtiEnv</struct>
2051	    </outptr>
2052	    <description>
2053	      The <jvmti/> environment.
2054	    </description>
2055	  </param>
2056          <param id="jni_env">
2057            <outptr>
2058              <struct>JNIEnv</struct>
2059            </outptr>
2060            <description>
2061              The JNI environment.
2062            </description>
2063          </param>
2064          <param id="arg">
2065            <outptr>
2066              <void/>
2067            </outptr>
2068              <description>
2069                The <code>arg</code> parameter passed to
2070                <functionlink id="RunAgentThread"></functionlink>.
2071              </description>
2072          </param>
2073      </parameters>
2074    </callback>
2075
2076    <function id="RunAgentThread" num="12">
2077      <synopsis>Run Agent Thread</synopsis>
2078      <description>
2079	Starts the execution of an agent thread. with the specified native function.
2080	The parameter <paramlink id="arg"></paramlink> is forwarded on to the
2081	<functionlink id="jvmtiStartFunction">start function</functionlink>
2082	(specified with <paramlink id="proc"></paramlink>) as its single argument.
2083	This function allows the creation of agent threads
2084	for handling communication with another process or for handling events
2085	without the need to load a special subclass of <code>java.lang.Thread</code> or
2086	implementer of <code>java.lang.Runnable</code>.
2087	Instead, the created thread can run entirely in native code.
2088	However, the created thread does require a newly created instance
2089	of <code>java.lang.Thread</code> (referenced by the argument <code>thread</code>) to
2090	which it will be associated.
2091	The thread object can be created with JNI calls.
2092	<p/>
2093	The following common thread priorities are provided for your convenience:
2094	<constants id="jvmtiThreadPriority" label="Thread Priority Constants" kind="const">
2095	  <constant id="JVMTI_THREAD_MIN_PRIORITY" num="1">
2096	    Minimum possible thread priority
2097	  </constant>
2098	  <constant id="JVMTI_THREAD_NORM_PRIORITY" num="5">
2099	    Normal thread priority
2100	  </constant>
2101	  <constant id="JVMTI_THREAD_MAX_PRIORITY" num="10">
2102	    Maximum possible thread priority
2103	  </constant>
2104	</constants>
2105	<p/>
2106	The new thread is started as a daemon thread with the specified
2107	<paramlink id="priority"></paramlink>.
2108        If enabled, a <eventlink id="ThreadStart"/> event will be sent.
2109	<p/>
2110        Since the thread has been started, the thread will be live when this function
2111        returns, unless the thread has died immediately.
2112	<p/>
2113        The thread group of the thread is ignored -- specifically, the thread is not
2114        added to the thread group and the thread is not seen on queries of the thread
2115        group at either the Java programming language or <jvmti/> levels.
2116	<p/>
2117        The thread is not visible to Java programming language queries but is
2118        included in <jvmti/> queries (for example,
2119        <functionlink id="GetAllThreads"/> and
2120        <functionlink id="GetAllStackTraces"/>).
2121	<p/>
2122	Upon execution of <code>proc</code>, the new thread will be attached to the
2123	VM -- see the JNI documentation on
2124	<externallink id="jni/invocation.html#attaching-to-the-vm"
2125		      >Attaching to the VM</externallink>.
2126      </description>
2127      <origin>jvmdiClone</origin>
2128      <capabilities>
2129      </capabilities>
2130      <parameters>
2131	<param id="thread">
2132	  <jthread impl="noconvert" started="no"/>
2133	    <description>
2134	      The thread to run.
2135	    </description>
2136	</param>
2137	<param id="proc">
2138	  <ptrtype>
2139	    <struct>jvmtiStartFunction</struct>
2140	  </ptrtype>
2141	  <description>
2142	    The start function.
2143	  </description>
2144	</param>
2145	<param id="arg">
2146	  <inbuf>
2147            <void/>
2148            <nullok><code>NULL</code> is passed to the start function</nullok>
2149          </inbuf>
2150	  <description>
2151	    The argument to the start function.
2152	  </description>
2153	</param>
2154	<param id="priority">
2155	  <jint/>
2156	  <description>
2157	    The priority of the started thread. Any thread
2158	    priority allowed by <code>java.lang.Thread.setPriority</code> can be used including
2159	    those in <datalink id="jvmtiThreadPriority"></datalink>.
2160	  </description>
2161	</param>
2162      </parameters>
2163      <errors>
2164	<error id="JVMTI_ERROR_INVALID_PRIORITY">
2165            <paramlink id="priority"/> is less than
2166            <datalink id="JVMTI_THREAD_MIN_PRIORITY"/>
2167              or greater than
2168            <datalink id="JVMTI_THREAD_MAX_PRIORITY"/>
2169	</error>
2170      </errors>
2171    </function>
2172
2173    <function id="SetThreadLocalStorage" jkernel="yes" impl="notrace" phase="start" num="103">
2174      <synopsis>Set Thread Local Storage</synopsis>
2175      <description>
2176	The VM stores a pointer value associated with each environment-thread
2177	pair. This pointer value is called <i>thread-local storage</i>.
2178        This value is <code>NULL</code> unless set with this function.
2179	Agents can allocate memory in which they store thread specific
2180        information. By setting thread-local storage it can then be
2181	accessed with
2182	<functionlink id="GetThreadLocalStorage"></functionlink>.
2183	<p/>
2184        This function is called by the agent to set the value of the <jvmti/>
2185        thread-local storage. <jvmti/> supplies to the agent a pointer-size
2186        thread-local storage that can be used to record per-thread
2187        information.
2188      </description>
2189      <origin>jvmpi</origin>
2190      <capabilities>
2191      </capabilities>
2192      <parameters>
2193        <param id="thread">
2194	  <jthread null="current"/>
2195	    <description>
2196	      Store to this thread.
2197	    </description>
2198	</param>
2199        <param id="data">
2200	  <inbuf>
2201	    <void/>
2202	    <nullok>value is set to <code>NULL</code></nullok>
2203	  </inbuf>
2204	  <description>
2205	    The value to be entered into the thread-local storage.
2206	  </description>
2207	</param>
2208      </parameters>
2209      <errors>
2210      </errors>
2211    </function>
2212
2213    <function id="GetThreadLocalStorage" jkernel="yes" impl="innative notrace" phase="start" num="102">
2214      <synopsis>Get Thread Local Storage</synopsis>
2215      <description>
2216        Called by the agent to get the value of the <jvmti/> thread-local
2217        storage.
2218      </description>
2219      <origin>jvmpi</origin>
2220      <capabilities>
2221      </capabilities>
2222      <parameters>
2223        <param id="thread">
2224	  <jthread null="current" impl="noconvert"/>
2225	    <description>
2226	      Retrieve from this thread.
2227	    </description>
2228	</param>
2229        <param id="data_ptr">
2230	  <agentbuf><void/></agentbuf>
2231	  <description>
2232	    Pointer through which the value of the thread local
2233	    storage is returned.
2234	    If thread-local storage has not been set with
2235	    <functionlink id="SetThreadLocalStorage"></functionlink> the returned
2236	    pointer is <code>NULL</code>.
2237	  </description>
2238	</param>
2239      </parameters>
2240      <errors>
2241      </errors>
2242    </function>
2243
2244  </category>
2245
2246  <category id="thread_groups" label="Thread Group">
2247    <intro>
2248    </intro>
2249
2250    <function id="GetTopThreadGroups" num="13">
2251      <synopsis>Get Top Thread Groups</synopsis>
2252      <description>
2253	Return all top-level (parentless) thread groups in the VM.
2254      </description>
2255      <origin>jvmdi</origin>
2256      <capabilities>
2257      </capabilities>
2258      <parameters>
2259	<param id="group_count_ptr">
2260	  <outptr><jint/></outptr>
2261	  <description>
2262	    On return, points to the number of top-level thread groups.
2263	  </description>
2264	</param>
2265	<param id="groups_ptr">
2266	  <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf>
2267	    <description>
2268	      On return, refers to a pointer to the top-level thread group array.
2269	    </description>
2270	</param>
2271      </parameters>
2272      <errors>
2273      </errors>
2274    </function>
2275
2276    <function id="GetThreadGroupInfo" num="14">
2277      <synopsis>Get Thread Group Info</synopsis>
2278      <typedef id="jvmtiThreadGroupInfo" label="Thread group information structure">
2279	<field id="parent">
2280	  <jthreadGroup/>
2281	  <description>
2282	    The parent thread group.
2283	  </description>
2284	</field>
2285	<field id="name">
2286	  <allocfieldbuf><char/></allocfieldbuf>
2287	  <description>
2288	    The thread group's name, encoded as a
2289	    <internallink id="mUTF">modified UTF-8</internallink> string.
2290	  </description>
2291	</field>
2292	<field id="max_priority">
2293	  <jint/>
2294	  <description>
2295	    The maximum priority for this thread group.
2296	  </description>
2297	</field>
2298	<field id="is_daemon">
2299	  <jboolean/>
2300	  <description>
2301	    Is this a daemon thread group?
2302	  </description>
2303	</field>
2304      </typedef>
2305      <description>
2306	Get information about the thread group. The fields of the
2307	<functionlink id="jvmtiThreadGroupInfo"></functionlink> structure
2308	are filled in with details of the specified thread group.
2309      </description>
2310      <origin>jvmdi</origin>
2311      <capabilities>
2312      </capabilities>
2313      <parameters>
2314	<param id="group">
2315	  <jthreadGroup/>
2316	  <description>
2317	    The thread group to query.
2318	  </description>
2319	</param>
2320	<param id="info_ptr">
2321	  <outptr><struct>jvmtiThreadGroupInfo</struct></outptr>
2322	  <description>
2323	    On return, filled with information describing the specified
2324	    thread group.
2325	  </description>
2326	</param>
2327      </parameters>
2328      <errors>
2329      </errors>
2330    </function>
2331
2332    <function id="GetThreadGroupChildren" num="15">
2333      <synopsis>Get Thread Group Children</synopsis>
2334      <description>
2335	Get the live threads and active subgroups in this thread group.
2336      </description>
2337      <origin>jvmdi</origin>
2338      <capabilities>
2339      </capabilities>
2340      <parameters>
2341	<param id="group">
2342	  <jthreadGroup/>
2343	  <description>
2344	    The group to query.
2345	  </description>
2346	</param>
2347	<param id="thread_count_ptr">
2348	  <outptr><jint/></outptr>
2349	  <description>
2350	    On return, points to the number of live threads in this thread group.
2351	  </description>
2352	</param>
2353	<param id="threads_ptr">
2354	  <allocbuf outcount="thread_count_ptr"><jthread/></allocbuf>
2355	    <description>
2356	      On return, points to an array of the live threads in this thread group.
2357	    </description>
2358	</param>
2359	<param id="group_count_ptr">
2360	  <outptr><jint/></outptr>
2361	  <description>
2362	    On return, points to the number of active child thread groups
2363	  </description>
2364	</param>
2365	<param id="groups_ptr">
2366	  <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf>
2367	    <description>
2368	      On return, points to an array of the active child thread groups.
2369	    </description>
2370	</param>
2371      </parameters>
2372      <errors>
2373      </errors>
2374    </function>
2375  </category>
2376
2377  <category id="stack" label="Stack Frame">
2378    <intro>
2379        These functions provide information about the stack of a thread.
2380        Stack frames are referenced by depth.
2381        The frame at depth zero is the current frame.
2382        <p/>
2383        Stack frames are as described in
2384        <vmspec chapter="3.6"/>,
2385        That is, they correspond to method
2386        invocations (including native methods) but do not correspond to platform native or
2387        VM internal frames.
2388        <p/>
2389        A <jvmti/> implementation may use method invocations to launch a thread and
2390        the corresponding frames may be included in the stack as presented by these functions --
2391        that is, there may be frames shown
2392        deeper than <code>main()</code> and <code>run()</code>.
2393        However this presentation must be consistent across all <jvmti/> functionality which
2394        uses stack frames or stack depth.
2395    </intro>
2396
2397      <typedef id="jvmtiFrameInfo" label="Stack frame information structure">
2398        <description>
2399          Information about a stack frame is returned in this structure.
2400        </description>
2401        <field id="method">
2402	  <jmethodID/>
2403	    <description>
2404	      The method executing in this frame.
2405	    </description>
2406	</field>
2407        <field id="location">
2408	  <jlocation/>
2409	  <description>
2410	    The index of the instruction executing in this frame.
2411            <code>-1</code> if the frame is executing a native method.
2412	  </description>
2413	</field>
2414      </typedef>
2415
2416      <typedef id="jvmtiStackInfo" label="Stack information structure">
2417        <description>
2418          Information about a set of stack frames is returned in this structure.
2419        </description>
2420        <field id="thread">
2421	  <jthread/>
2422	  <description>
2423	    On return, the thread traced.
2424	  </description>
2425	</field>
2426        <field id="state">
2427	  <jint/>
2428	  <description>
2429	    On return, the thread state. See <functionlink id="GetThreadState"></functionlink>.
2430	  </description>
2431	</field>
2432        <field id="frame_buffer">
2433	  <outbuf incount="max_frame_count">
2434	    <struct>jvmtiFrameInfo</struct>
2435	  </outbuf>
2436	    <description>
2437	      On return, this agent allocated buffer is filled
2438	      with stack frame information.
2439	    </description>
2440	</field>
2441        <field id="frame_count">
2442	  <jint/>
2443	  <description>
2444	    On return, the number of records filled into
2445            <code>frame_buffer</code>.
2446            This will be
2447            min(<code>max_frame_count</code>, <i>stackDepth</i>).
2448	  </description>
2449	</field>
2450      </typedef>
2451
2452    <function id="GetStackTrace" num="104">
2453      <synopsis>Get Stack Trace</synopsis>
2454      <description>
2455        Get information about the stack of a thread.
2456        If <paramlink id="max_frame_count"></paramlink> is less than the depth of the stack,
2457        the <paramlink id="max_frame_count"></paramlink> topmost frames are returned,
2458        otherwise the entire stack is returned.
2459        The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2460        <p/>
2461        The following example causes up to five of the topmost frames
2462        to be returned and (if there are any frames) the currently
2463        executing method name to be printed.
2464        <example>
2465jvmtiFrameInfo frames[5];
2466jint count;
2467jvmtiError err;
2468
2469err = (*jvmti)-&gt;GetStackTrace(jvmti, aThread, 0, 5,
2470                               frames, &amp;count);
2471if (err == JVMTI_ERROR_NONE &amp;&amp; count &gt;= 1) {
2472   char *methodName;
2473   err = (*jvmti)-&gt;GetMethodName(jvmti, frames[0].method,
2474                       &amp;methodName, NULL, NULL);
2475   if (err == JVMTI_ERROR_NONE) {
2476      printf("Executing method: %s", methodName);
2477   }
2478}
2479        </example>
2480        <todo>
2481          check example code.
2482        </todo>
2483        <p/>
2484        The <paramlink id="thread"></paramlink> need not be suspended
2485        to call this function.
2486        <p/>
2487        The <functionlink id="GetLineNumberTable"></functionlink>
2488        function can be used to map locations to line numbers. Note that
2489        this mapping can be done lazily.
2490      </description>
2491      <origin>jvmpi</origin>
2492      <capabilities>
2493      </capabilities>
2494      <parameters>
2495        <param id="thread">
2496	  <jthread null="current"/>
2497	    <description>
2498	      Fetch the stack trace of this thread.
2499	    </description>
2500	</param>
2501        <param id="start_depth">
2502	  <jint/>
2503	  <description>
2504	    Begin retrieving frames at this depth.
2505            If non-negative, count from the current frame,
2506            the first frame retrieved is at depth <code>start_depth</code>.
2507            For example, if zero, start from the current frame; if one, start from the
2508            caller of the current frame; if two, start from the caller of the
2509            caller of the current frame; and so on.
2510            If negative, count from below the oldest frame,
2511            the first frame retrieved is at depth <i>stackDepth</i><code> + start_depth</code>,
2512            where <i>stackDepth</i> is the count of frames on the stack.
2513            For example, if negative one, only the oldest frame is retrieved;
2514            if negative two, start from the frame called by the oldest frame.
2515	  </description>
2516	</param>
2517        <param id="max_frame_count">
2518	  <jint min="0"/>
2519	  <description>
2520	    The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2521	  </description>
2522	</param>
2523        <param id="frame_buffer">
2524	  <outbuf incount="max_frame_count" outcount="count_ptr">
2525	    <struct>jvmtiFrameInfo</struct>
2526	  </outbuf>
2527	    <description>
2528	      On return, this agent allocated buffer is filled
2529	      with stack frame information.
2530	    </description>
2531	</param>
2532        <param id="count_ptr">
2533	  <outptr><jint/></outptr>
2534	  <description>
2535	    On return, points to the number of records filled in.
2536            For non-negative <code>start_depth</code>, this will be
2537            min(<code>max_frame_count</code>, <i>stackDepth</i><code> - start_depth</code>).
2538            For negative <code>start_depth</code>, this will be
2539            min(<code>max_frame_count</code>, <code>-start_depth</code>).
2540	  </description>
2541	</param>
2542      </parameters>
2543      <errors>
2544	<error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
2545	  <paramlink id="start_depth"/> is positive and greater than or equal to <i>stackDepth</i>.
2546	  Or <paramlink id="start_depth"/> is negative and less than <i>-stackDepth</i>.
2547	</error>
2548      </errors>
2549    </function>
2550
2551
2552    <function id="GetAllStackTraces" num="100">
2553      <synopsis>Get All Stack Traces</synopsis>
2554      <description>
2555        Get information about the stacks of all live threads
2556        (including <internallink id="RunAgentThread">agent threads</internallink>).
2557        If <paramlink id="max_frame_count"/> is less than the depth of a stack,
2558        the <paramlink id="max_frame_count"/> topmost frames are returned for that thread,
2559        otherwise the entire stack is returned.
2560        The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2561        <p/>
2562        All stacks are collected simultaneously, that is, no changes will occur to the
2563        thread state or stacks between the sampling of one thread and the next.
2564        The threads need not be suspended.
2565
2566        <example>
2567jvmtiStackInfo *stack_info;
2568jint thread_count;
2569int ti;
2570jvmtiError err;
2571
2572err = (*jvmti)-&gt;GetAllStackTraces(jvmti, MAX_FRAMES, &amp;stack_info, &amp;thread_count);
2573if (err != JVMTI_ERROR_NONE) {
2574   ...
2575}
2576for (ti = 0; ti &lt; thread_count; ++ti) {
2577   jvmtiStackInfo *infop = &amp;stack_info[ti];
2578   jthread thread = infop-&gt;thread;
2579   jint state = infop-&gt;state;
2580   jvmtiFrameInfo *frames = infop-&gt;frame_buffer;
2581   int fi;
2582
2583   myThreadAndStatePrinter(thread, state);
2584   for (fi = 0; fi &lt; infop-&gt;frame_count; fi++) {
2585      myFramePrinter(frames[fi].method, frames[fi].location);
2586   }
2587}
2588/* this one Deallocate call frees all data allocated by GetAllStackTraces */
2589err = (*jvmti)-&gt;Deallocate(jvmti, stack_info);
2590        </example>
2591        <todo>
2592          check example code.
2593        </todo>
2594
2595      </description>
2596      <origin>new</origin>
2597      <capabilities>
2598      </capabilities>
2599      <parameters>
2600        <param id="max_frame_count">
2601	  <jint min="0"/>
2602	  <description>
2603	    The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread.
2604	  </description>
2605	</param>
2606        <param id="stack_info_ptr">
2607	  <allocbuf>
2608	    <struct>jvmtiStackInfo</struct>
2609	  </allocbuf>
2610	    <description>
2611	      On return, this buffer is filled
2612	      with stack information for each thread.
2613              The number of <datalink id="jvmtiStackInfo"/> records is determined
2614              by <paramlink id="thread_count_ptr"/>.
2615              <p/>
2616              Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/>
2617              buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>.
2618              These buffers must not be separately deallocated.
2619	    </description>
2620	</param>
2621        <param id="thread_count_ptr">
2622	  <outptr><jint/></outptr>
2623	  <description>
2624	    The number of threads traced.
2625	  </description>
2626	</param>
2627      </parameters>
2628      <errors>
2629      </errors>
2630    </function>
2631
2632    <function id="GetThreadListStackTraces" num="101">
2633      <synopsis>Get Thread List Stack Traces</synopsis>
2634      <description>
2635        Get information about the stacks of the supplied threads.
2636        If <paramlink id="max_frame_count"/> is less than the depth of a stack,
2637        the <paramlink id="max_frame_count"/> topmost frames are returned for that thread,
2638        otherwise the entire stack is returned.
2639        The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2640        <p/>
2641        All stacks are collected simultaneously, that is, no changes will occur to the
2642        thread state or stacks between the sampling one thread and the next.
2643        The threads need not be suspended.
2644        <p/>
2645        If a thread has not yet started or terminates before the stack information is collected,
2646        a zero length stack (<datalink id="jvmtiStackInfo.frame_count"/> will be zero)
2647        will be returned and the thread <datalink id="jvmtiStackInfo.state"/> can be checked.
2648        <p/>
2649        See the example for the similar function
2650        <functionlink id="GetAllStackTraces"/>.
2651      </description>
2652      <origin>new</origin>
2653      <capabilities>
2654      </capabilities>
2655      <parameters>
2656        <param id="thread_count">
2657	  <jint min="0"/>
2658	  <description>
2659	    The number of threads to trace.
2660	  </description>
2661	</param>
2662        <param id="thread_list">
2663	  <inbuf incount="thread_count"><jthread/></inbuf>
2664	    <description>
2665	      The list of threads to trace.
2666	    </description>
2667	</param>
2668        <param id="max_frame_count">
2669	  <jint min="0"/>
2670	  <description>
2671	    The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread.
2672	  </description>
2673	</param>
2674        <param id="stack_info_ptr">
2675	  <allocbuf outcount="thread_count">
2676	    <struct>jvmtiStackInfo</struct>
2677	  </allocbuf>
2678	    <description>
2679	      On return, this buffer is filled
2680	      with stack information for each thread.
2681              The number of <datalink id="jvmtiStackInfo"/> records is determined
2682              by <paramlink id="thread_count"/>.
2683              <p/>
2684              Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/>
2685              buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>.
2686              These buffers must not be separately deallocated.
2687	    </description>
2688	</param>
2689      </parameters>
2690      <errors>
2691	<error id="JVMTI_ERROR_INVALID_THREAD">
2692	  An element in <paramlink id="thread_list"/> is not a thread object.
2693	</error>
2694      </errors>
2695    </function>
2696
2697    <elide>
2698    <function id="AsyncGetStackTrace" num="1000">
2699      <synopsis>Get Stack Trace--Asynchronous</synopsis>
2700      <description>
2701        Get information about the entire stack of a thread (or a sub-section of it).
2702        This is the asynchronous version of <functionlink id="GetStackTrace"></functionlink>
2703        and is reentrant and safe to call
2704        from asynchronous signal handlers.
2705        The stack trace is returned only for the calling thread.
2706        <p/>
2707        The <functionlink id="GetLineNumberTable"></functionlink>
2708        function can be used to map locations to line numbers. Note that
2709        this mapping can be done lazily.
2710      </description>
2711      <origin>jvmpi</origin>
2712      <capabilities>
2713        <required id="can_get_async_stack_trace"></required>
2714        <capability id="can_show_JVM_spec_async_frames">
2715          If <code>false</code>,
2716          <paramlink id="use_java_stack"></paramlink>
2717          must be <code>false</code>.
2718        </capability>
2719      </capabilities>
2720      <parameters>
2721        <param id="use_java_stack">
2722	  <jboolean/>
2723	  <description>
2724	    Return the stack showing <vmspec/>
2725	    model of the stack;
2726	    otherwise, show the internal representation of the stack with
2727	    inlined and optimized methods missing.  If the virtual machine
2728	    is using the <i>Java Virtual Machine Specification</i> stack model
2729	    internally, this flag is ignored.
2730	  </description>
2731	</param>
2732        <param id="max_count">
2733	  <jint min="0"/>
2734	  <description>
2735	    The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2736	    Retrieve this many unless the stack depth is less than <code>max_count</code>.
2737	  </description>
2738	</param>
2739        <param id="frame_buffer">
2740	  <outbuf incount="max_count" outcount="count_ptr">
2741	    <struct>jvmtiFrameInfo</struct>
2742	    <nullok>this information is not returned</nullok>
2743	  </outbuf>
2744	    <description>
2745	      The agent passes in a buffer
2746	      large enough to hold <code>max_count</code> records of
2747	      <datalink id="jvmtiFrameInfo"></datalink>.  This buffer must be
2748	      pre-allocated by the agent.
2749	    </description>
2750	</param>
2751        <param id="count_ptr">
2752	  <outptr><jint/></outptr>
2753	  <description>
2754	    On return, points to the number of records filled in..
2755	  </description>
2756	</param>
2757      </parameters>
2758      <errors>
2759        <error id="JVMTI_ERROR_UNATTACHED_THREAD">
2760          The thread being used to call this function is not attached
2761          to the virtual machine.  Calls must be made from attached threads.
2762        </error>
2763      </errors>
2764    </function>
2765    </elide>
2766
2767    <function id="GetFrameCount" num="16">
2768      <synopsis>Get Frame Count</synopsis>
2769      <description>
2770	Get the number of frames currently in the specified thread's call stack.
2771	<p/>
2772	If this function is called for a thread actively executing bytecodes (for example,
2773	not the current thread and not suspended), the information returned is transient.
2774      </description>
2775      <origin>jvmdi</origin>
2776      <capabilities>
2777      </capabilities>
2778      <parameters>
2779	<param id="thread">
2780	  <jthread null="current"/>
2781	    <description>
2782	      The thread to query.
2783	    </description>
2784	</param>
2785	<param id="count_ptr">
2786	  <outptr><jint/></outptr>
2787	  <description>
2788	    On return, points to the number of frames in the call stack.
2789	  </description>
2790	</param>
2791      </parameters>
2792      <errors>
2793      </errors>
2794    </function>
2795
2796    <function id="PopFrame" num="80">
2797      <synopsis>Pop Frame</synopsis>
2798      <description>
2799	Pop the current frame of <code>thread</code>'s stack.
2800	Popping a frame takes you to the previous frame.
2801	When the thread is resumed, the execution
2802	state of the thread is reset to the state
2803	immediately before the called method was invoked.
2804	That is (using <vmspec/> terminology):
2805	  <ul>
2806	    <li>the current frame is discarded as the previous frame becomes the current one</li>
2807	    <li>the operand stack is restored--the argument values are added back
2808	      and if the invoke was not <code>invokestatic</code>,
2809	      <code>objectref</code> is added back as well</li>
2810	    <li>the Java virtual machine PC is restored to the opcode
2811	      of the invoke instruction</li>
2812	  </ul>
2813	Note however, that any changes to the arguments, which
2814	occurred in the called method, remain;
2815	when execution continues, the first instruction to
2816	execute will be the invoke.
2817	<p/>
2818	Between calling <code>PopFrame</code> and resuming the
2819	thread the state of the stack is undefined.
2820	To pop frames beyond the first,
2821	these three steps must be repeated:
2822	<ul>
2823	  <li>suspend the thread via an event (step, breakpoint, ...)</li>
2824	  <li>call <code>PopFrame</code></li>
2825	  <li>resume the thread</li>
2826	</ul>
2827	<p/>
2828	A lock acquired by calling the called method
2829	(if it is a <code>synchronized</code>  method)
2830	and locks acquired by entering <code>synchronized</code>
2831	blocks within the called method are released.
2832	Note: this does not apply to native locks or
2833	<code>java.util.concurrent.locks</code> locks.
2834	<p/>
2835	Finally blocks are not executed.
2836	<p/>
2837	Changes to global state are not addressed and thus remain changed.
2838	<p/>
2839	The specified thread must be suspended (which implies it cannot be the current thread).
2840	<p/>
2841	Both the called method and calling method must be non-native Java programming
2842        language methods.
2843	<p/>
2844	No <jvmti/> events are generated by this function.
2845      </description>
2846      <origin>jvmdi</origin>
2847      <capabilities>
2848	<required id="can_pop_frame"></required>
2849      </capabilities>
2850      <parameters>
2851	<param id="thread">
2852	  <jthread/>
2853	    <description>
2854	      The thread whose current frame is to be popped.
2855	    </description>
2856	</param>
2857      </parameters>
2858      <errors>
2859	<error id="JVMTI_ERROR_OPAQUE_FRAME">
2860	  Called or calling method is a native method.
2861          The implementation is unable to pop this frame.
2862	</error>
2863	<error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
2864	  Thread was not suspended.
2865	</error>
2866	<error id="JVMTI_ERROR_NO_MORE_FRAMES">
2867	  There are less than two stack frames on the call stack.
2868	</error>
2869      </errors>
2870    </function>
2871
2872    <function id="GetFrameLocation" num="19">
2873      <synopsis>Get Frame Location</synopsis>
2874      <description>
2875	<p/>
2876	For a Java programming language frame, return the location of the instruction
2877	currently executing.
2878      </description>
2879      <origin>jvmdiClone</origin>
2880      <capabilities>
2881      </capabilities>
2882      <parameters>
2883 	<param id="thread">
2884	  <jthread null="current" frame="frame"/>
2885	  <description>
2886	    The thread of the frame to query.
2887	  </description>
2888	</param>
2889	<param id="depth">
2890	  <jframeID thread="thread"/>
2891	  <description>
2892	    The depth of the frame to query.
2893	  </description>
2894	</param>
2895	<param id="method_ptr">
2896	  <outptr><jmethodID/></outptr>
2897	    <description>
2898	      On return, points to the method for the current location.
2899	    </description>
2900	</param>
2901	<param id="location_ptr">
2902	  <outptr><jlocation/></outptr>
2903	  <description>
2904	    On return, points to the index of the currently
2905	    executing instruction.
2906            Is set to <code>-1</code> if the frame is executing
2907            a native method.
2908	  </description>
2909	</param>
2910      </parameters>
2911      <errors>
2912      </errors>
2913    </function>
2914
2915    <function id="NotifyFramePop" num="20">
2916      <synopsis>Notify Frame Pop</synopsis>
2917      <description>
2918	When the frame that is currently at <paramlink id="depth"></paramlink>
2919        is popped from the stack, generate a
2920	<eventlink id="FramePop"></eventlink> event.  See the
2921	<eventlink id="FramePop"></eventlink> event for details.
2922        Only frames corresponding to non-native Java programming language
2923        methods can receive notification.
2924        <p/>
2925        The specified thread must either be the current thread
2926        or the thread must be suspended.
2927      </description>
2928      <origin>jvmdi</origin>
2929      <capabilities>
2930	<required id="can_generate_frame_pop_events"></required>
2931      </capabilities>
2932      <parameters>
2933 	<param id="thread">
2934	  <jthread null="current" frame="depth"/>
2935	  <description>
2936	    The thread of the frame for which the frame pop event will be generated.
2937	  </description>
2938	</param>
2939	<param id="depth">
2940	  <jframeID thread="thread"/>
2941	  <description>
2942	    The depth of the frame for which the frame pop event will be generated.
2943	  </description>
2944	</param>
2945      </parameters>
2946      <errors>
2947	<error id="JVMTI_ERROR_OPAQUE_FRAME">
2948	  The frame at <code>depth</code> is executing a
2949          native method.
2950	</error>
2951	<error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
2952	  Thread was not suspended and was not the current thread.
2953	</error>
2954      </errors>
2955    </function>
2956
2957  </category>
2958
2959  <category id="ForceEarlyReturn" label="Force Early Return">
2960    <intro>
2961      These functions allow an agent to force a method
2962      to return at any point during its execution.
2963      The method which will return early is referred to as the <i>called method</i>.
2964      The called method is the current method
2965      (as defined by
2966      <vmspec chapter="3.6"/>)
2967      for the specified thread at
2968      the time the function is called.
2969      <p/>
2970      The specified thread must be suspended or must be the current thread.
2971      The return occurs when execution of Java programming
2972      language code is resumed on this thread.
2973      Between calling one of these functions and resumption
2974      of thread execution, the state of the stack is undefined.
2975      <p/>
2976      No further instructions are executed in the called method.
2977      Specifically, finally blocks are not executed.
2978      Note: this can cause inconsistent states in the application.
2979      <p/>
2980      A lock acquired by calling the called method
2981      (if it is a <code>synchronized</code>  method)
2982      and locks acquired by entering <code>synchronized</code>
2983      blocks within the called method are released.
2984      Note: this does not apply to native locks or
2985      <code>java.util.concurrent.locks</code> locks.
2986      <p/>
2987      Events, such as <eventlink id="MethodExit"></eventlink>,
2988      are generated as they would be in a normal return.
2989      <p/>
2990      The called method must be a non-native Java programming
2991      language method.
2992      Forcing return on a thread with only one frame on the
2993      stack causes the thread to exit when resumed.
2994    </intro>
2995
2996    <function id="ForceEarlyReturnObject" num="81" since="1.1">
2997      <synopsis>Force Early Return - Object</synopsis>
2998      <description>
2999	This function can be used to return from a method whose
3000        result type is <code>Object</code>
3001        or a subclass of <code>Object</code>.
3002      </description>
3003      <origin>new</origin>
3004      <capabilities>
3005	<required id="can_force_early_return"></required>
3006      </capabilities>
3007      <parameters>
3008	<param id="thread">
3009	  <jthread null="current"/>
3010	  <description>
3011	    The thread whose current frame is to return early.
3012	  </description>
3013	</param>
3014	<param id="value">
3015	  <jobject/>
3016	  <description>
3017	    The return value for the called frame.
3018            An object or <code>NULL</code>.
3019	  </description>
3020	</param>
3021      </parameters>
3022      <errors>
3023	<error id="JVMTI_ERROR_OPAQUE_FRAME">
3024	  Attempted to return early from a frame
3025          corresponding to a native method.
3026          Or the implementation is unable to provide
3027          this functionality on this frame.
3028	</error>
3029	<error id="JVMTI_ERROR_TYPE_MISMATCH">
3030	  The result type of the called method is not
3031          <code>Object</code> or a subclass of <code>Object</code>.
3032	</error>
3033	<error id="JVMTI_ERROR_TYPE_MISMATCH">
3034	  The supplied <paramlink id="value"/> is not compatible with the
3035          result type of the called method.
3036	</error>
3037	<error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3038	  Thread was not the current thread and was not suspended.
3039	</error>
3040	<error id="JVMTI_ERROR_NO_MORE_FRAMES">
3041	  There are no more frames on the call stack.
3042	</error>
3043      </errors>
3044    </function>
3045
3046    <function id="ForceEarlyReturnInt" num="82" since="1.1">
3047      <synopsis>Force Early Return - Int</synopsis>
3048      <description>
3049	This function can be used to return from a method whose
3050        result type is <code>int</code>, <code>short</code>,
3051        <code>char</code>, <code>byte</code>, or
3052	<code>boolean</code>.
3053      </description>
3054      <origin>new</origin>
3055      <capabilities>
3056	<required id="can_force_early_return"></required>
3057      </capabilities>
3058      <parameters>
3059	<param id="thread">
3060	  <jthread null="current"/>
3061	  <description>
3062	    The thread whose current frame is to return early.
3063	  </description>
3064	</param>
3065	<param id="value">
3066	  <jint/>
3067	  <description>
3068	    The return value for the called frame.
3069	  </description>
3070	</param>
3071      </parameters>
3072      <errors>
3073	<error id="JVMTI_ERROR_OPAQUE_FRAME">
3074	  Attempted to return early from a frame
3075          corresponding to a native method.
3076          Or the implementation is unable to provide
3077          this functionality on this frame.
3078	</error>
3079	<error id="JVMTI_ERROR_TYPE_MISMATCH">
3080	  The result type of the called method is not
3081          <code>int</code>, <code>short</code>,
3082          <code>char</code>, <code>byte</code>, or
3083  	  <code>boolean</code>.
3084	</error>
3085	<error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3086	  Thread was not the current thread and was not suspended.
3087	</error>
3088	<error id="JVMTI_ERROR_NO_MORE_FRAMES">
3089	  There are no frames on the call stack.
3090	</error>
3091      </errors>
3092    </function>
3093
3094    <function id="ForceEarlyReturnLong" num="83" since="1.1">
3095      <synopsis>Force Early Return - Long</synopsis>
3096      <description>
3097	This function can be used to return from a method whose
3098        result type is <code>long</code>.
3099      </description>
3100      <origin>new</origin>
3101      <capabilities>
3102	<required id="can_force_early_return"></required>
3103      </capabilities>
3104      <parameters>
3105	<param id="thread">
3106	  <jthread null="current"/>
3107	  <description>
3108	    The thread whose current frame is to return early.
3109	  </description>
3110	</param>
3111	<param id="value">
3112	  <jlong/>
3113	  <description>
3114	    The return value for the called frame.
3115	  </description>
3116	</param>
3117      </parameters>
3118      <errors>
3119	<error id="JVMTI_ERROR_OPAQUE_FRAME">
3120	  Attempted to return early from a frame
3121          corresponding to a native method.
3122          Or the implementation is unable to provide
3123          this functionality on this frame.
3124	</error>
3125	<error id="JVMTI_ERROR_TYPE_MISMATCH">
3126	  The result type of the called method is not <code>long</code>.
3127	</error>
3128	<error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3129	  Thread was not the current thread and was not suspended.
3130	</error>
3131	<error id="JVMTI_ERROR_NO_MORE_FRAMES">
3132	  There are no frames on the call stack.
3133	</error>
3134      </errors>
3135    </function>
3136
3137    <function id="ForceEarlyReturnFloat" num="84" since="1.1">
3138      <synopsis>Force Early Return - Float</synopsis>
3139      <description>
3140	This function can be used to return from a method whose
3141        result type is <code>float</code>.
3142      </description>
3143      <origin>new</origin>
3144      <capabilities>
3145	<required id="can_force_early_return"></required>
3146      </capabilities>
3147      <parameters>
3148	<param id="thread">
3149	  <jthread null="current"/>
3150	  <description>
3151	    The thread whose current frame is to return early.
3152	  </description>
3153	</param>
3154	<param id="value">
3155	  <jfloat/>
3156	  <description>
3157	    The return value for the called frame.
3158	  </description>
3159	</param>
3160      </parameters>
3161      <errors>
3162	<error id="JVMTI_ERROR_OPAQUE_FRAME">
3163	  Attempted to return early from a frame
3164          corresponding to a native method.
3165          Or the implementation is unable to provide
3166          this functionality on this frame.
3167	</error>
3168	<error id="JVMTI_ERROR_TYPE_MISMATCH">
3169	  The result type of the called method is not <code>float</code>.
3170	</error>
3171	<error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3172	  Thread was not the current thread and was not suspended.
3173	</error>
3174	<error id="JVMTI_ERROR_NO_MORE_FRAMES">
3175	  There are no frames on the call stack.
3176	</error>
3177      </errors>
3178    </function>
3179
3180    <function id="ForceEarlyReturnDouble" num="85" since="1.1">
3181      <synopsis>Force Early Return - Double</synopsis>
3182      <description>
3183	This function can be used to return from a method whose
3184        result type is <code>double</code>.
3185      </description>
3186      <origin>new</origin>
3187      <capabilities>
3188	<required id="can_force_early_return"></required>
3189      </capabilities>
3190      <parameters>
3191	<param id="thread">
3192	  <jthread null="current"/>
3193	  <description>
3194	    The thread whose current frame is to return early.
3195	  </description>
3196	</param>
3197	<param id="value">
3198	  <jdouble/>
3199	  <description>
3200	    The return value for the called frame.
3201	  </description>
3202	</param>
3203      </parameters>
3204      <errors>
3205	<error id="JVMTI_ERROR_OPAQUE_FRAME">
3206	  Attempted to return early from a frame corresponding to a native method.
3207          Or the implementation is unable to provide this functionality on this frame.
3208	</error>
3209	<error id="JVMTI_ERROR_TYPE_MISMATCH">
3210	  The result type of the called method is not <code>double</code>.
3211	</error>
3212	<error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3213	  Thread was not the current thread and was not suspended.
3214	</error>
3215	<error id="JVMTI_ERROR_NO_MORE_FRAMES">
3216	  There are no frames on the call stack.
3217	</error>
3218      </errors>
3219    </function>
3220
3221    <function id="ForceEarlyReturnVoid" num="86" since="1.1">
3222      <synopsis>Force Early Return - Void</synopsis>
3223      <description>
3224	This function can be used to return from a method with no result type.
3225        That is, the called method must be declared <code>void</code>.
3226      </description>
3227      <origin>new</origin>
3228      <capabilities>
3229	<required id="can_force_early_return"></required>
3230      </capabilities>
3231      <parameters>
3232	<param id="thread">
3233	  <jthread null="current"/>
3234	  <description>
3235	    The thread whose current frame is to return early.
3236	  </description>
3237	</param>
3238      </parameters>
3239      <errors>
3240	<error id="JVMTI_ERROR_OPAQUE_FRAME">
3241	  Attempted to return early from a frame
3242          corresponding to a native method.
3243          Or the implementation is unable to provide
3244          this functionality on this frame.
3245	</error>
3246	<error id="JVMTI_ERROR_TYPE_MISMATCH">
3247	  The called method has a result type.
3248	</error>
3249	<error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3250	  Thread was not the current thread and was not suspended.
3251	</error>
3252	<error id="JVMTI_ERROR_NO_MORE_FRAMES">
3253	  There are no frames on the call stack.
3254	</error>
3255      </errors>
3256    </function>
3257
3258  </category>
3259
3260  <category id="Heap" label="Heap">
3261    <intro>
3262      These functions are used to analyze the heap.
3263      Functionality includes the ability to view the objects in the
3264      heap and to tag these objects.
3265    </intro>
3266
3267    <intro id="objectTags" label="Object Tags">
3268      A <i>tag</i> is a value associated with an object.
3269      Tags are explicitly set by the agent using the
3270      <functionlink id="SetTag"></functionlink> function or by
3271      callback functions such as <functionlink id="jvmtiHeapIterationCallback"/>.
3272      <p/>
3273      Tags are local to the environment; that is, the tags of one
3274      environment are not visible in another.
3275      <p/>
3276      Tags are <code>jlong</code> values which can be used
3277      simply to mark an object or to store a pointer to more detailed
3278      information.  Objects which have not been tagged have a
3279      tag of zero.
3280      Setting a tag to zero makes the object untagged.
3281    </intro>
3282
3283    <intro id="heapCallbacks" label="Heap Callback Functions">
3284        Heap functions which iterate through the heap and recursively
3285        follow object references use agent supplied callback functions
3286        to deliver the information.
3287        <p/>
3288        These heap callback functions must adhere to the following restrictions --
3289        These callbacks must not use JNI functions.
3290        These callbacks must not use <jvmti/> functions except
3291        <i>callback safe</i> functions which
3292        specifically allow such use (see the raw monitor, memory management,
3293        and environment local storage functions).
3294        <p/>
3295        An implementation may invoke a callback on an internal thread or
3296        the thread which called the iteration function.
3297        Heap callbacks are single threaded -- no more than one callback will
3298        be invoked at a time.
3299        <p/>
3300        The Heap Filter Flags can be used to prevent reporting
3301        based on the tag status of an object or its class.
3302        If no flags are set (the <code>jint</code> is zero), objects
3303        will not be filtered out.
3304
3305        <constants id="jvmtiHeapFilter" label="Heap Filter Flags" kind="bits">
3306	  <constant id="JVMTI_HEAP_FILTER_TAGGED" num="0x4">
3307	    Filter out tagged objects. Objects which are tagged are not included.
3308	  </constant>
3309	  <constant id="JVMTI_HEAP_FILTER_UNTAGGED" num="0x8">
3310	    Filter out untagged objects. Objects which are not tagged are not included.
3311	  </constant>
3312	  <constant id="JVMTI_HEAP_FILTER_CLASS_TAGGED" num="0x10">
3313	    Filter out objects with tagged classes. Objects whose class is tagged are not included.
3314	  </constant>
3315	  <constant id="JVMTI_HEAP_FILTER_CLASS_UNTAGGED" num="0x20">
3316	    Filter out objects with untagged classes. Objects whose class is not tagged are not included.
3317	  </constant>
3318	</constants>
3319
3320        <p/>
3321        The Heap Visit Control Flags are returned by the heap callbacks
3322        and can be used to abort the iteration.  For the
3323        <functionlink id="jvmtiHeapReferenceCallback">Heap
3324        Reference Callback</functionlink>, it can also be used
3325        to prune the graph of traversed references
3326        (<code>JVMTI_VISIT_OBJECTS</code> is not set).
3327
3328        <constants id="jvmtiHeapVisitControl"
3329                   label="Heap Visit Control Flags"
3330                   kind="bits"
3331                   since="1.1">
3332	  <constant id="JVMTI_VISIT_OBJECTS" num="0x100">
3333            If we are visiting an object and if this callback
3334            was initiated by <functionlink id="FollowReferences"/>,
3335            traverse the references of this object.
3336            Otherwise ignored.
3337	  </constant>
3338	  <constant id="JVMTI_VISIT_ABORT" num="0x8000">
3339	    Abort the iteration.  Ignore all other bits.
3340	  </constant>
3341	</constants>
3342
3343        <p/>
3344        The Heap Reference Enumeration is provided by the
3345        <functionlink id="jvmtiHeapReferenceCallback">Heap
3346        Reference Callback</functionlink> and
3347        <functionlink id="jvmtiPrimitiveFieldCallback">Primitive Field
3348        Callback</functionlink> to
3349        describe the kind of reference
3350        being reported.
3351
3352        <constants id="jvmtiHeapReferenceKind"
3353                   label="Heap Reference Enumeration"
3354                   kind="enum"
3355                   since="1.1">
3356	  <constant id="JVMTI_HEAP_REFERENCE_CLASS" num="1">
3357	    Reference from an object to its class.
3358	  </constant>
3359	  <constant id="JVMTI_HEAP_REFERENCE_FIELD" num="2">
3360	    Reference from an object to the value of one of its instance fields.
3361	  </constant>
3362	  <constant id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT" num="3">
3363	    Reference from an array to one of its elements.
3364	  </constant>
3365	  <constant id="JVMTI_HEAP_REFERENCE_CLASS_LOADER" num="4">
3366	    Reference from a class to its class loader.
3367	  </constant>
3368	  <constant id="JVMTI_HEAP_REFERENCE_SIGNERS" num="5">
3369	    Reference from a class to its signers array.
3370	  </constant>
3371	  <constant id="JVMTI_HEAP_REFERENCE_PROTECTION_DOMAIN" num="6">
3372	    Reference from a class to its protection domain.
3373	  </constant>
3374	  <constant id="JVMTI_HEAP_REFERENCE_INTERFACE" num="7">
3375            Reference from a class to one of its interfaces.
3376            Note: interfaces are defined via a constant pool reference,
3377            so the referenced interfaces may also be reported with a
3378            <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind.
3379	  </constant>
3380	  <constant id="JVMTI_HEAP_REFERENCE_STATIC_FIELD" num="8">
3381	    Reference from a class to the value of one of its static fields.
3382	  </constant>
3383	  <constant id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL" num="9">
3384	    Reference from a class to a resolved entry in the constant pool.
3385	  </constant>
3386	  <constant id="JVMTI_HEAP_REFERENCE_SUPERCLASS" num="10">
3387            Reference from a class to its superclass.
3388            A callback is not sent if the superclass is <code>java.lang.Object</code>.
3389            Note: loaded classes define superclasses via a constant pool
3390            reference, so the referenced superclass may also be reported with
3391            a <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind.
3392	  </constant>
3393	  <constant id="JVMTI_HEAP_REFERENCE_JNI_GLOBAL" num="21">
3394	    Heap root reference: JNI global reference.
3395	  </constant>
3396	  <constant id="JVMTI_HEAP_REFERENCE_SYSTEM_CLASS" num="22">
3397	    Heap root reference: System class.
3398	  </constant>
3399	  <constant id="JVMTI_HEAP_REFERENCE_MONITOR" num="23">
3400	    Heap root reference: monitor.
3401	  </constant>
3402	  <constant id="JVMTI_HEAP_REFERENCE_STACK_LOCAL" num="24">
3403	    Heap root reference: local variable on the stack.
3404	  </constant>
3405	  <constant id="JVMTI_HEAP_REFERENCE_JNI_LOCAL" num="25">
3406	    Heap root reference: JNI local reference.
3407	  </constant>
3408	  <constant id="JVMTI_HEAP_REFERENCE_THREAD" num="26">
3409	    Heap root reference: Thread.
3410	  </constant>
3411	  <constant id="JVMTI_HEAP_REFERENCE_OTHER" num="27">
3412	    Heap root reference: other heap root reference.
3413	  </constant>
3414	</constants>
3415
3416        <p/>
3417        Definitions for the single character type descriptors of
3418        primitive types.
3419
3420        <constants id="jvmtiPrimitiveType"
3421                   label="Primitive Type Enumeration"
3422                   kind="enum"
3423                   since="1.1">
3424	  <constant id="JVMTI_PRIMITIVE_TYPE_BOOLEAN" num="90">
3425            'Z' - Java programming language <code>boolean</code> - JNI <code>jboolean</code>
3426	  </constant>
3427	  <constant id="JVMTI_PRIMITIVE_TYPE_BYTE" num="66">
3428            'B' - Java programming language <code>byte</code> - JNI <code>jbyte</code>
3429	  </constant>
3430	  <constant id="JVMTI_PRIMITIVE_TYPE_CHAR" num="67">
3431            'C' - Java programming language <code>char</code> - JNI <code>jchar</code>
3432	  </constant>
3433	  <constant id="JVMTI_PRIMITIVE_TYPE_SHORT" num="83">
3434            'S' - Java programming language <code>short</code> - JNI <code>jshort</code>
3435	  </constant>
3436	  <constant id="JVMTI_PRIMITIVE_TYPE_INT" num="73">
3437            'I' - Java programming language <code>int</code> - JNI <code>jint</code>
3438	  </constant>
3439	  <constant id="JVMTI_PRIMITIVE_TYPE_LONG" num="74">
3440            'J' - Java programming language <code>long</code> - JNI <code>jlong</code>
3441	  </constant>
3442	  <constant id="JVMTI_PRIMITIVE_TYPE_FLOAT" num="70">
3443            'F' - Java programming language <code>float</code> - JNI <code>jfloat</code>
3444	  </constant>
3445	  <constant id="JVMTI_PRIMITIVE_TYPE_DOUBLE" num="68">
3446            'D' - Java programming language <code>double</code> - JNI <code>jdouble</code>
3447	  </constant>
3448	</constants>
3449    </intro>
3450
3451      <typedef id="jvmtiHeapReferenceInfoField"
3452               label="Reference information structure for Field references"
3453               since="1.1">
3454        <description>
3455          Reference information returned for
3456          <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> and
3457          <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references.
3458        </description>
3459	<field id="index">
3460	  <jint/>
3461	  <description>
3462            For <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>, the
3463            referrer object is not a class or an interface.
3464            In this case, <code>index</code> is the index of the field
3465            in the class of the referrer object.
3466            This class is referred to below as <i>C</i>.
3467            <p/>
3468            For <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
3469            the referrer object is a class (referred to below as <i>C</i>)
3470            or an interface (referred to below as <i>I</i>).
3471            In this case, <code>index</code> is the index of the field in
3472            that class or interface.
3473            <p/>
3474            If the referrer object is not an interface, then the field
3475            indices are determined as follows:
3476            <ul>
3477              <li>make a list of all the fields in <i>C</i> and its
3478                  superclasses, starting with all the fields in
3479                  <code>java.lang.Object</code> and ending with all the
3480                  fields in <i>C</i>.</li>
3481              <li>Within this list, put
3482                  the fields for a given class in the order returned by
3483                  <functionlink id="GetClassFields"/>.</li>
3484              <li>Assign the fields in this list indices
3485                  <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i>
3486                  is the count of the fields in all the interfaces
3487                  implemented by <i>C</i>.
3488                  Note that <i>C</i> implements all interfaces
3489                  directly implemented by its superclasses; as well
3490                  as all superinterfaces of these interfaces.</li>
3491            </ul>
3492            If the referrer object is an interface, then the field
3493            indices are determined as follows:
3494            <ul>
3495              <li>make a list of the fields directly declared in
3496                  <i>I</i>.</li>
3497              <li>Within this list, put
3498                  the fields in the order returned by
3499                  <functionlink id="GetClassFields"/>.</li>
3500              <li>Assign the fields in this list indices
3501                  <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i>
3502                  is the count of the fields in all the superinterfaces
3503                  of <i>I</i>.</li>
3504            </ul>
3505            All fields are included in this computation, regardless of
3506            field modifier (static, public, private, etc).
3507            <p/>
3508            For example, given the following classes and interfaces:
3509            <example>
3510interface I0 {
3511    int p = 0;
3512}
3513
3514interface I1 extends I0 {
3515    int x = 1;
3516}
3517
3518interface I2 extends I0 {
3519    int y = 2;
3520}
3521
3522class C1 implements I1 {
3523    public static int a = 3;
3524    private int b = 4;
3525}
3526
3527class C2 extends C1 implements I2 {
3528    static int q = 5;
3529    final int r = 6;
3530}
3531            </example>
3532            Assume that <functionlink id="GetClassFields"/> called on
3533            <code>C1</code> returns the fields of <code>C1</code> in the
3534            order: a, b; and that the fields of <code>C2</code> are
3535            returned in the order: q, r.
3536            An instance of class <code>C1</code> will have the
3537            following field indices:
3538            <blockquote><table>
3539              <tr>
3540                <td class="centered">
3541                  a
3542                </td>
3543                <td class="centered">
3544                  2
3545                </td>
3546                <td>
3547                  The count of the fields in the interfaces
3548                  implemented by <code>C1</code> is two (<i>n</i>=2):
3549                  <code>p</code> of <code>I0</code>
3550                  and <code>x</code> of <code>I1</code>.
3551                </td>
3552              </tr>
3553              <tr>
3554                <td class="centered">
3555                  b
3556                </td>
3557                <td class="centered">
3558                  3
3559                </td>
3560                <td>
3561                  the subsequent index.
3562                </td>
3563              </tr>
3564            </table></blockquote>
3565            The class <code>C1</code> will have the same field indices.
3566            <p/>
3567            An instance of class <code>C2</code> will have the
3568            following field indices:
3569            <blockquote><table>
3570              <tr>
3571                <td class="centered">
3572                  a
3573                </td>
3574                <td class="centered">
3575                  3
3576                </td>
3577                <td>
3578                  The count of the fields in the interfaces
3579                  implemented by <code>C2</code> is three (<i>n</i>=3):
3580                  <code>p</code> of <code>I0</code>,
3581                  <code>x</code> of <code>I1</code> and <code>y</code> of <code>I2</code>
3582                  (an interface of <code>C2</code>).  Note that the field <code>p</code>
3583                  of <code>I0</code> is only included once.
3584                </td>
3585              </tr>
3586              <tr>
3587                <td class="centered">
3588                  b
3589                </td>
3590                <td class="centered">
3591                  4
3592                </td>
3593                <td>
3594                  the subsequent index to "a".
3595                </td>
3596              </tr>
3597              <tr>
3598                <td class="centered">
3599                  q
3600                </td>
3601                <td class="centered">
3602                  5
3603                </td>
3604                <td>
3605                  the subsequent index to "b".
3606                </td>
3607              </tr>
3608              <tr>
3609                <td class="centered">
3610                  r
3611                </td>
3612                <td class="centered">
3613                  6
3614                </td>
3615                <td>
3616                  the subsequent index to "q".
3617                </td>
3618              </tr>
3619            </table></blockquote>
3620            The class <code>C2</code> will have the same field indices.
3621            Note that a field may have a different index depending on the
3622            object that is viewing it -- for example field "a" above.
3623            Note also: not all field indices may be visible from the
3624            callbacks, but all indices are shown for illustrative purposes.
3625            <p/>
3626            The interface <code>I1</code> will have the
3627            following field indices:
3628            <blockquote><table>
3629              <tr>
3630                <td class="centered">
3631                  x
3632                </td>
3633                <td class="centered">
3634                  1
3635                </td>
3636                <td>
3637                  The count of the fields in the superinterfaces
3638                  of <code>I1</code> is one (<i>n</i>=1):
3639                  <code>p</code> of <code>I0</code>.
3640                </td>
3641              </tr>
3642            </table></blockquote>
3643	  </description>
3644	</field>
3645      </typedef>
3646
3647      <typedef id="jvmtiHeapReferenceInfoArray"
3648               label="Reference information structure for Array references"
3649               since="1.1">
3650        <description>
3651          Reference information returned for
3652         <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references.
3653        </description>
3654	<field id="index">
3655	  <jint/>
3656	  <description>
3657	    The array index.
3658	  </description>
3659	</field>
3660      </typedef>
3661
3662      <typedef id="jvmtiHeapReferenceInfoConstantPool"
3663               label="Reference information structure for Constant Pool references"
3664               since="1.1">
3665        <description>
3666          Reference information returned for
3667          <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references.
3668        </description>
3669	<field id="index">
3670	  <jint/>
3671	  <description>
3672	    The index into the constant pool of the class. See the description in
3673      <vmspec chapter="4.4"/>.
3674	  </description>
3675	</field>
3676      </typedef>
3677
3678      <typedef id="jvmtiHeapReferenceInfoStackLocal"
3679               label="Reference information structure for Local Variable references"
3680               since="1.1">
3681        <description>
3682          Reference information returned for
3683          <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references.
3684        </description>
3685        <field id="thread_tag">
3686	  <jlong/>
3687	  <description>
3688	    The tag of the thread corresponding to this stack, zero if not tagged.
3689	  </description>
3690	</field>
3691        <field id="thread_id">
3692	  <jlong/>
3693	  <description>
3694	    The unique thread ID of the thread corresponding to this stack.
3695	  </description>
3696	</field>
3697        <field id="depth">
3698	  <jint/>
3699	  <description>
3700	    The depth of the frame.
3701	  </description>
3702	</field>
3703        <field id="method">
3704	  <jmethodID/>
3705	  <description>
3706	    The method executing in this frame.
3707	  </description>
3708	</field>
3709        <field id="location">
3710	  <jlocation/>
3711	  <description>
3712	    The currently executing location in this frame.
3713	  </description>
3714	</field>
3715        <field id="slot">
3716	  <jint/>
3717	  <description>
3718	    The slot number of the local variable.
3719	  </description>
3720	</field>
3721      </typedef>
3722
3723      <typedef id="jvmtiHeapReferenceInfoJniLocal"
3724               label="Reference information structure for JNI local references"
3725               since="1.1">
3726        <description>
3727          Reference information returned for
3728          <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references.
3729        </description>
3730        <field id="thread_tag">
3731	  <jlong/>
3732	  <description>
3733	    The tag of the thread corresponding to this stack, zero if not tagged.
3734	  </description>
3735	</field>
3736        <field id="thread_id">
3737	  <jlong/>
3738	  <description>
3739	    The unique thread ID of the thread corresponding to this stack.
3740	  </description>
3741	</field>
3742        <field id="depth">
3743	  <jint/>
3744	  <description>
3745	    The depth of the frame.
3746	  </description>
3747	</field>
3748        <field id="method">
3749	  <jmethodID/>
3750	  <description>
3751	    The method executing in this frame.
3752	  </description>
3753	</field>
3754      </typedef>
3755
3756      <typedef id="jvmtiHeapReferenceInfoReserved"
3757               label="Reference information structure for Other references"
3758               since="1.1">
3759        <description>
3760          Reference information returned for other references.
3761        </description>
3762        <field id="reserved1">
3763	  <jlong/>
3764	  <description>
3765	    reserved for future use.
3766	  </description>
3767	</field>
3768        <field id="reserved2">
3769	  <jlong/>
3770	  <description>
3771	    reserved for future use.
3772	  </description>
3773	</field>
3774        <field id="reserved3">
3775	  <jlong/>
3776	  <description>
3777	    reserved for future use.
3778	  </description>
3779	</field>
3780        <field id="reserved4">
3781	  <jlong/>
3782	  <description>
3783	    reserved for future use.
3784	  </description>
3785	</field>
3786        <field id="reserved5">
3787	  <jlong/>
3788	  <description>
3789	    reserved for future use.
3790	  </description>
3791	</field>
3792        <field id="reserved6">
3793	  <jlong/>
3794	  <description>
3795	    reserved for future use.
3796	  </description>
3797	</field>
3798        <field id="reserved7">
3799	  <jlong/>
3800	  <description>
3801	    reserved for future use.
3802	  </description>
3803	</field>
3804        <field id="reserved8">
3805	  <jlong/>
3806	  <description>
3807	    reserved for future use.
3808	  </description>
3809	</field>
3810      </typedef>
3811
3812      <uniontypedef id="jvmtiHeapReferenceInfo"
3813               label="Reference information structure"
3814               since="1.1">
3815        <description>
3816          The information returned about referrers.
3817          Represented as a union of the various kinds of reference information.
3818        </description>
3819	<field id="field">
3820	  <struct>jvmtiHeapReferenceInfoField</struct>
3821	  <description>
3822	    The referrer information for
3823            <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>
3824            and <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references.
3825	  </description>
3826	</field>
3827	<field id="array">
3828	  <struct>jvmtiHeapReferenceInfoArray</struct>
3829	  <description>
3830	    The referrer information for
3831	    For <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references.
3832	  </description>
3833	</field>
3834	<field id="constant_pool">
3835	  <struct>jvmtiHeapReferenceInfoConstantPool</struct>
3836	  <description>
3837	    The referrer information for
3838	    For <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references.
3839	  </description>
3840	</field>
3841        <field id="stack_local">
3842	  <struct>jvmtiHeapReferenceInfoStackLocal</struct>
3843	  <description>
3844	    The referrer information for
3845	    For <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references.
3846	  </description>
3847	</field>
3848        <field id="jni_local">
3849	  <struct>jvmtiHeapReferenceInfoJniLocal</struct>
3850	  <description>
3851	    The referrer information for
3852	    For <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references.
3853	  </description>
3854	</field>
3855        <field id="other">
3856	  <struct>jvmtiHeapReferenceInfoReserved</struct>
3857	  <description>
3858	    reserved for future use.
3859	  </description>
3860	</field>
3861      </uniontypedef>
3862
3863      <typedef id="jvmtiHeapCallbacks"
3864               label="Heap callback function structure"
3865               since="1.1">
3866        <field id="heap_iteration_callback">
3867	  <ptrtype>
3868	    <struct>jvmtiHeapIterationCallback</struct>
3869	  </ptrtype>
3870	  <description>
3871	    The callback to be called to describe an
3872	    object in the heap. Used by the
3873            <functionlink id="IterateThroughHeap"/> function, ignored by the
3874            <functionlink id="FollowReferences"/> function.
3875	  </description>
3876	</field>
3877        <field id="heap_reference_callback">
3878	  <ptrtype>
3879	    <struct>jvmtiHeapReferenceCallback</struct>
3880	  </ptrtype>
3881	  <description>
3882	    The callback to be called to describe an
3883	    object reference.  Used by the
3884            <functionlink id="FollowReferences"/> function, ignored by the
3885            <functionlink id="IterateThroughHeap"/> function.
3886	  </description>
3887	</field>
3888        <field id="primitive_field_callback">
3889	  <ptrtype>
3890	    <struct>jvmtiPrimitiveFieldCallback</struct>
3891	  </ptrtype>
3892	  <description>
3893            The callback to be called to describe a
3894            primitive field.
3895          </description>
3896	</field>
3897        <field id="array_primitive_value_callback">
3898	  <ptrtype>
3899	    <struct>jvmtiArrayPrimitiveValueCallback</struct>
3900	  </ptrtype>
3901	  <description>
3902	    The callback to be called to describe an
3903	    array of primitive values.
3904	  </description>
3905	</field>
3906        <field id="string_primitive_value_callback">
3907	  <ptrtype>
3908	    <struct>jvmtiStringPrimitiveValueCallback</struct>
3909	  </ptrtype>
3910	  <description>
3911	    The callback to be called to describe a String value.
3912	  </description>
3913	</field>
3914        <field id="reserved5">
3915	  <ptrtype>
3916	    <struct>jvmtiReservedCallback</struct>
3917	  </ptrtype>
3918	  <description>
3919	    Reserved for future use..
3920	  </description>
3921	</field>
3922        <field id="reserved6">
3923	  <ptrtype>
3924	    <struct>jvmtiReservedCallback</struct>
3925	  </ptrtype>
3926	  <description>
3927	    Reserved for future use..
3928	  </description>
3929	</field>
3930        <field id="reserved7">
3931	  <ptrtype>
3932	    <struct>jvmtiReservedCallback</struct>
3933	  </ptrtype>
3934	  <description>
3935	    Reserved for future use..
3936	  </description>
3937	</field>
3938        <field id="reserved8">
3939	  <ptrtype>
3940	    <struct>jvmtiReservedCallback</struct>
3941	  </ptrtype>
3942	  <description>
3943	    Reserved for future use..
3944	  </description>
3945	</field>
3946        <field id="reserved9">
3947	  <ptrtype>
3948	    <struct>jvmtiReservedCallback</struct>
3949	  </ptrtype>
3950	  <description>
3951	    Reserved for future use..
3952	  </description>
3953	</field>
3954        <field id="reserved10">
3955	  <ptrtype>
3956	    <struct>jvmtiReservedCallback</struct>
3957	  </ptrtype>
3958	  <description>
3959	    Reserved for future use..
3960	  </description>
3961	</field>
3962        <field id="reserved11">
3963	  <ptrtype>
3964	    <struct>jvmtiReservedCallback</struct>
3965	  </ptrtype>
3966	  <description>
3967	    Reserved for future use..
3968	  </description>
3969	</field>
3970        <field id="reserved12">
3971	  <ptrtype>
3972	    <struct>jvmtiReservedCallback</struct>
3973	  </ptrtype>
3974	  <description>
3975	    Reserved for future use..
3976	  </description>
3977	</field>
3978        <field id="reserved13">
3979	  <ptrtype>
3980	    <struct>jvmtiReservedCallback</struct>
3981	  </ptrtype>
3982	  <description>
3983	    Reserved for future use..
3984	  </description>
3985	</field>
3986        <field id="reserved14">
3987	  <ptrtype>
3988	    <struct>jvmtiReservedCallback</struct>
3989	  </ptrtype>
3990	  <description>
3991	    Reserved for future use..
3992	  </description>
3993	</field>
3994        <field id="reserved15">
3995	  <ptrtype>
3996	    <struct>jvmtiReservedCallback</struct>
3997	  </ptrtype>
3998	  <description>
3999	    Reserved for future use..
4000	  </description>
4001	</field>
4002      </typedef>
4003
4004
4005    <intro>
4006      <rationale>
4007	The heap dumping functionality (below) uses a callback
4008	for each object.  While it would seem that a buffered approach
4009	would provide better throughput, tests do
4010	not show this to be the case--possibly due to locality of
4011	memory reference or array access overhead.
4012      </rationale>
4013
4014      <issue>
4015        Still under investigation as to if java.lang.ref references
4016	are reported as a different type of reference.
4017      </issue>
4018
4019      <issue>
4020        Should or can an indication of the cost or relative cost of
4021	these operations be included?
4022      </issue>
4023
4024    </intro>
4025
4026    <callback id="jvmtiHeapIterationCallback" since="1.1">
4027      <jint/>
4028      <synopsis>Heap Iteration Callback</synopsis>
4029      <description>
4030        Agent supplied callback function.
4031	Describes (but does not pass in) an object in the heap.
4032        <p/>
4033        This function should return a bit vector of the desired
4034        <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4035        This will determine if the entire iteration should be aborted
4036        (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4037        <p/>
4038        See the <internallink id="heapCallbacks">heap callback
4039        function restrictions</internallink>.
4040      </description>
4041      <parameters>
4042        <param id="class_tag">
4043	  <jlong/>
4044	  <description>
4045	    The tag of the class of object (zero if the class is not tagged).
4046	    If the object represents a runtime class,
4047            the <code>class_tag</code> is the tag
4048	    associated with <code>java.lang.Class</code>
4049            (zero if <code>java.lang.Class</code> is not tagged).
4050	  </description>
4051	</param>
4052        <param id="size">
4053	  <jlong/>
4054	  <description>
4055	    Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
4056	  </description>
4057	</param>
4058        <param id="tag_ptr">
4059	  <outptr><jlong/></outptr>
4060	  <description>
4061	    The object tag value, or zero if the object is not tagged.
4062	    To set the tag value to be associated with the object
4063	    the agent sets the <code>jlong</code> pointed to by the parameter.
4064	  </description>
4065	</param>
4066        <param id="length">
4067	  <jint/>
4068	  <description>
4069	    If this object is an array, the length of the array. Otherwise negative one (-1).
4070	  </description>
4071	</param>
4072        <param id="user_data">
4073	  <outptr><void/></outptr>
4074	  <description>
4075	    The user supplied data that was passed into the iteration function.
4076	  </description>
4077	</param>
4078      </parameters>
4079    </callback>
4080
4081    <callback id="jvmtiHeapReferenceCallback" since="1.1">
4082      <jint/>
4083      <synopsis>Heap Reference Callback</synopsis>
4084      <description>
4085        Agent supplied callback function.
4086	Describes a reference from an object or the VM (the referrer) to another object
4087	(the referree) or a heap root to a referree.
4088        <p/>
4089        This function should return a bit vector of the desired
4090        <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4091        This will determine if the objects referenced by the referree
4092        should be visited or if the entire iteration should be aborted.
4093        <p/>
4094        See the <internallink id="heapCallbacks">heap callback
4095        function restrictions</internallink>.
4096      </description>
4097      <parameters>
4098	<param id="reference_kind">
4099	  <enum>jvmtiHeapReferenceKind</enum>
4100	  <description>
4101	    The kind of reference.
4102	  </description>
4103	</param>
4104	<param id="reference_info">
4105	  <inptr>
4106	    <struct>jvmtiHeapReferenceInfo</struct>
4107	  </inptr>
4108	  <description>
4109	    Details about the reference.
4110            Set when the <datalink id="jvmtiHeapReferenceCallback.reference_kind">reference_kind</datalink> is
4111            <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>,
4112	    <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
4113	    <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/>,
4114	    <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/>,
4115            <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/>,
4116            or <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/>.
4117            Otherwise <code>NULL</code>.
4118	  </description>
4119	</param>
4120        <param id="class_tag">
4121	  <jlong/>
4122	  <description>
4123	    The tag of the class of referree object (zero if the class is not tagged).
4124            If the referree object represents a runtime class,
4125            the <code>class_tag</code> is the tag
4126            associated with <code>java.lang.Class</code>
4127            (zero if <code>java.lang.Class</code> is not tagged).
4128	  </description>
4129	</param>
4130        <param id="referrer_class_tag">
4131          <jlong/>
4132          <description>
4133            The tag of the class of the referrer object (zero if the class is not tagged
4134            or the referree is a heap root). If the referrer object represents a runtime
4135            class, the <code>referrer_class_tag</code> is the tag associated with
4136            the <code>java.lang.Class</code>
4137            (zero if <code>java.lang.Class</code> is not tagged).
4138          </description>
4139        </param>
4140        <param id="size">
4141	  <jlong/>
4142	  <description>
4143	    Size of the referree object (in bytes).
4144            See <functionlink id="GetObjectSize"/>.
4145	  </description>
4146	</param>
4147        <param id="tag_ptr">
4148	  <outptr><jlong/></outptr>
4149	  <description>
4150	    Points to the referree object tag value, or zero if the object is not
4151	    tagged.
4152	    To set the tag value to be associated with the object
4153	    the agent sets the <code>jlong</code> pointed to by the parameter.
4154	  </description>
4155	</param>
4156        <param id="referrer_tag_ptr">
4157	  <outptr><jlong/></outptr>
4158	  <description>
4159	    Points to the tag of the referrer object, or
4160            points to the zero if the referrer
4161	    object is not tagged.
4162            <code>NULL</code> if the referrer in not an object (that is,
4163            this callback is reporting a heap root).
4164	    To set the tag value to be associated with the referrer object
4165	    the agent sets the <code>jlong</code> pointed to by the parameter.
4166            If this callback is reporting a reference from an object to itself,
4167            <code>referrer_tag_ptr == tag_ptr</code>.
4168	  </description>
4169	</param>
4170        <param id="length">
4171	  <jint/>
4172	  <description>
4173	    If this object is an array, the length of the array. Otherwise negative one (-1).
4174	  </description>
4175	</param>
4176        <param id="user_data">
4177	  <outptr><void/></outptr>
4178	  <description>
4179	    The user supplied data that was passed into the iteration function.
4180	  </description>
4181	</param>
4182      </parameters>
4183    </callback>
4184
4185    <callback id="jvmtiPrimitiveFieldCallback" since="1.1">
4186      <jint/>
4187      <synopsis>Primitive Field Callback</synopsis>
4188      <description>
4189        Agent supplied callback function which
4190        describes a primitive field of an object (<i>the object</i>).
4191        A primitive field is a field whose type is a primitive type.
4192        This callback will describe a static field if the object is a class,
4193        and otherwise will describe an instance field.
4194        <p/>
4195        This function should return a bit vector of the desired
4196        <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4197        This will determine if the entire iteration should be aborted
4198        (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4199        <p/>
4200        See the <internallink id="heapCallbacks">heap callback
4201        function restrictions</internallink>.
4202      </description>
4203      <parameters>
4204	<param id="kind">
4205	  <enum>jvmtiHeapReferenceKind</enum>
4206	  <description>
4207	    The kind of field -- instance or static (<datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> or
4208            <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>).
4209	  </description>
4210	</param>
4211	<param id="info">
4212	  <inptr>
4213	    <struct>jvmtiHeapReferenceInfo</struct>
4214	  </inptr>
4215	  <description>
4216	    Which field (the field index).
4217	  </description>
4218	</param>
4219        <param id="object_class_tag">
4220	  <jlong/>
4221	  <description>
4222            The tag of the class of the object (zero if the class is not tagged).
4223            If the object represents a runtime class, the
4224            <code>object_class_tag</code> is the tag
4225            associated with <code>java.lang.Class</code>
4226            (zero if <code>java.lang.Class</code> is not tagged).
4227	  </description>
4228	</param>
4229        <param id="object_tag_ptr">
4230	  <outptr><jlong/></outptr>
4231	  <description>
4232	    Points to the tag of the object, or zero if the object is not
4233	    tagged.
4234	    To set the tag value to be associated with the object
4235	    the agent sets the <code>jlong</code> pointed to by the parameter.
4236	  </description>
4237	</param>
4238        <param id="value">
4239	  <jvalue/>
4240	  <description>
4241	    The value of the field.
4242	  </description>
4243	</param>
4244        <param id="value_type">
4245	  <enum>jvmtiPrimitiveType</enum>
4246	  <description>
4247	    The type of the field.
4248	  </description>
4249	</param>
4250        <param id="user_data">
4251	  <outptr><void/></outptr>
4252	  <description>
4253	    The user supplied data that was passed into the iteration function.
4254	  </description>
4255	</param>
4256      </parameters>
4257    </callback>
4258
4259    <callback id="jvmtiArrayPrimitiveValueCallback" since="1.1">
4260      <jint/>
4261      <synopsis>Array Primitive Value Callback</synopsis>
4262      <description>
4263        Agent supplied callback function.
4264	Describes the values in an array of a primitive type.
4265        <p/>
4266        This function should return a bit vector of the desired
4267        <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4268        This will determine if the entire iteration should be aborted
4269        (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4270        <p/>
4271        See the <internallink id="heapCallbacks">heap callback
4272        function restrictions</internallink>.
4273      </description>
4274      <parameters>
4275        <param id="class_tag">
4276	  <jlong/>
4277	  <description>
4278	    The tag of the class of the array object (zero if the class is not tagged).
4279	  </description>
4280	</param>
4281        <param id="size">
4282	  <jlong/>
4283	  <description>
4284	    Size of the array (in bytes).
4285            See <functionlink id="GetObjectSize"/>.
4286	  </description>
4287	</param>
4288        <param id="tag_ptr">
4289	  <outptr><jlong/></outptr>
4290	  <description>
4291	    Points to the tag of the array object, or zero if the object is not
4292	    tagged.
4293	    To set the tag value to be associated with the object
4294	    the agent sets the <code>jlong</code> pointed to by the parameter.
4295	  </description>
4296	</param>
4297        <param id="element_count">
4298	  <jint/>
4299	  <description>
4300	    The length of the primitive array.
4301	  </description>
4302	</param>
4303        <param id="element_type">
4304	  <enum>jvmtiPrimitiveType</enum>
4305	  <description>
4306	    The type of the elements of the array.
4307	  </description>
4308	</param>
4309        <param id="elements">
4310	  <vmbuf><void/></vmbuf>
4311	  <description>
4312	    The elements of the array in a packed array of <code>element_count</code>
4313            items of <code>element_type</code> size each.
4314	  </description>
4315	</param>
4316        <param id="user_data">
4317	  <outptr><void/></outptr>
4318	  <description>
4319	    The user supplied data that was passed into the iteration function.
4320	  </description>
4321	</param>
4322      </parameters>
4323    </callback>
4324
4325    <callback id="jvmtiStringPrimitiveValueCallback" since="1.1">
4326      <jint/>
4327      <synopsis>String Primitive Value Callback</synopsis>
4328      <description>
4329        Agent supplied callback function.
4330	Describes the value of a java.lang.String.
4331        <p/>
4332        This function should return a bit vector of the desired
4333        <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4334        This will determine if the entire iteration should be aborted
4335        (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4336        <p/>
4337        See the <internallink id="heapCallbacks">heap callback
4338        function restrictions</internallink>.
4339      </description>
4340      <parameters>
4341        <param id="class_tag">
4342	  <jlong/>
4343	  <description>
4344	    The tag of the class of the String class (zero if the class is not tagged).
4345            <issue>Is this needed?</issue>
4346	  </description>
4347	</param>
4348        <param id="size">
4349	  <jlong/>
4350	  <description>
4351	    Size of the string (in bytes).
4352            See <functionlink id="GetObjectSize"/>.
4353	  </description>
4354	</param>
4355        <param id="tag_ptr">
4356	  <outptr><jlong/></outptr>
4357	  <description>
4358	    Points to the tag of the String object, or zero if the object is not
4359	    tagged.
4360	    To set the tag value to be associated with the object
4361	    the agent sets the <code>jlong</code> pointed to by the parameter.
4362	  </description>
4363	</param>
4364        <param id="value">
4365	  <vmbuf><jchar/></vmbuf>
4366	  <description>
4367	    The value of the String, encoded as a Unicode string.
4368	  </description>
4369	</param>
4370        <param id="value_length">
4371	  <jint/>
4372	  <description>
4373	    The length of the string.
4374            The length is equal to the number of 16-bit Unicode
4375            characters in the string.
4376	  </description>
4377	</param>
4378        <param id="user_data">
4379	  <outptr><void/></outptr>
4380	  <description>
4381	    The user supplied data that was passed into the iteration function.
4382	  </description>
4383	</param>
4384      </parameters>
4385    </callback>
4386
4387
4388    <callback id="jvmtiReservedCallback" since="1.1">
4389      <jint/>
4390      <synopsis>reserved for future use Callback</synopsis>
4391      <description>
4392        Placeholder -- reserved for future use.
4393      </description>
4394      <parameters>
4395      </parameters>
4396    </callback>
4397
4398    <function id="FollowReferences" num="115" since="1.1">
4399      <synopsis>Follow References</synopsis>
4400      <description>
4401        This function initiates a traversal over the objects that are
4402        directly and indirectly reachable from the specified object or,
4403        if <code>initial_object</code> is not specified, all objects
4404        reachable from the heap roots.
4405	The heap root are the set of system classes,
4406	JNI globals, references from thread stacks, and other objects used as roots
4407	for the purposes of garbage collection.
4408        <p/>
4409        This function operates by traversing the reference graph.
4410        Let <i>A</i>, <i>B</i>, ... represent objects.
4411        When a reference from <i>A</i> to <i>B</i> is traversed,
4412        when a reference from a heap root to <i>B</i> is traversed,
4413        or when <i>B</i> is specified as the <paramlink id="initial_object"/>,
4414        then <i>B</i> is said to be <i>visited</i>.
4415        A reference from <i>A</i> to <i>B</i> is not traversed until <i>A</i>
4416        is visited.
4417        References are reported in the same order that the references are traversed.
4418        Object references are reported by invoking the agent supplied
4419        callback function <functionlink id="jvmtiHeapReferenceCallback"/>.
4420        In a reference from <i>A</i> to <i>B</i>, <i>A</i> is known
4421        as the <i>referrer</i> and <i>B</i> as the <i>referree</i>.
4422        The callback is invoked exactly once for each reference from a referrer;
4423        this is true even if there are reference cycles or multiple paths to
4424        the referrer.
4425        There may be more than one reference between a referrer and a referree,
4426        each reference is reported.
4427        These references may be distinguished by examining the
4428        <datalink
4429         id="jvmtiHeapReferenceCallback.reference_kind"><code>reference_kind</code></datalink>
4430         and
4431        <datalink
4432         id="jvmtiHeapReferenceCallback.reference_info"><code>reference_info</code></datalink>
4433        parameters of the <functionlink id="jvmtiHeapReferenceCallback"/> callback.
4434	<p/>
4435        This function reports a Java programming language view of object references,
4436        not a virtual machine implementation view. The following object references
4437        are reported when they are non-null:
4438        <ul>
4439          <li>Instance objects report references to each non-primitive instance fields
4440              (including inherited fields).</li>
4441          <li>Instance objects report a reference to the object type (class).</li>
4442          <li>Classes report a reference to the superclass and directly
4443              implemented/extended interfaces.</li>
4444          <li>Classes report a reference to the class loader, protection domain,
4445              signers, and resolved entries in the constant pool.</li>
4446          <li>Classes report a reference to each directly declared non-primitive
4447              static field.</li>
4448          <li>Arrays report a reference to the array type (class) and each
4449              array element.</li>
4450          <li>Primitive arrays report a reference to the array type.</li>
4451        </ul>
4452        <p/>
4453        This function can also be used to examine primitive (non-object) values.
4454        The primitive value of an array or String
4455        is reported after the object has been visited;
4456        it is reported by invoking the agent supplied callback function
4457        <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or
4458        <functionlink id="jvmtiStringPrimitiveValueCallback"/>.
4459        A primitive field
4460        is reported after the object with that field is visited;
4461        it is reported by invoking the agent supplied callback function
4462        <functionlink id="jvmtiPrimitiveFieldCallback"/>.
4463        <p/>
4464        Whether a callback is provided or is <code>NULL</code> only determines
4465        whether the callback will be invoked, it does not influence
4466        which objects are visited nor does it influence whether other callbacks
4467        will be invoked.
4468        However, the
4469        <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>
4470        returned by <functionlink id="jvmtiHeapReferenceCallback"/>
4471        do determine if the objects referenced by the
4472        current object as visited.
4473        The <datalink id="jvmtiHeapFilter">heap filter flags</datalink>
4474        and <paramlink id="klass"/> provided as parameters to this function
4475        do not control which objects are visited but they do control which
4476        objects and primitive values are reported by the callbacks.
4477        For example, if the only callback that was set is
4478        <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
4479        is set to the array of bytes class, then only arrays of byte will be
4480        reported.
4481        The table below summarizes this:
4482        <p/>
4483        <table>
4484          <tr>
4485            <th/>
4486            <th>
4487              Controls objects visited
4488            </th>
4489            <th>
4490              Controls objects reported
4491            </th>
4492            <th>
4493              Controls primitives reported
4494            </th>
4495          </tr>
4496          <tr>
4497            <th class="leftAligned">
4498              the
4499              <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4500              returned by <functionlink id="jvmtiHeapReferenceCallback"/>
4501            </th>
4502            <td class="centered">
4503              <b>Yes</b>
4504            </td>
4505            <td class="centered">
4506              <b>Yes</b>, since visits are controlled
4507            </td>
4508            <td class="centered">
4509              <b>Yes</b>, since visits are controlled
4510            </td>
4511          </tr>
4512          <tr>
4513            <th class="leftAligned">
4514              <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
4515              in <paramlink id="callbacks"/> set
4516            </th>
4517            <td class="centered">
4518              No
4519            </td>
4520            <td class="centered">
4521              <b>Yes</b>
4522            </td>
4523            <td class="centered">
4524              No
4525            </td>
4526          </tr>
4527          <tr>
4528            <th class="leftAligned">
4529              <paramlink id="heap_filter"/>
4530            </th>
4531            <td class="centered">
4532              No
4533            </td>
4534            <td class="centered">
4535              <b>Yes</b>
4536            </td>
4537            <td class="centered">
4538              <b>Yes</b>
4539            </td>
4540          </tr>
4541          <tr>
4542            <th class="leftAligned">
4543              <paramlink id="klass"/>
4544            </th>
4545            <td class="centered">
4546              No
4547            </td>
4548            <td class="centered">
4549              <b>Yes</b>
4550            </td>
4551            <td class="centered">
4552              <b>Yes</b>
4553            </td>
4554          </tr>
4555        </table>
4556        <p/>
4557        During the execution of this function the state of the heap
4558        does not change: no objects are allocated, no objects are
4559        garbage collected, and the state of objects (including
4560        held values) does not change.
4561        As a result, threads executing Java
4562        programming language code, threads attempting to resume the
4563        execution of Java programming language code, and threads
4564        attempting to execute JNI functions are typically stalled.
4565      </description>
4566      <origin>new</origin>
4567      <capabilities>
4568        <required id="can_tag_objects"></required>
4569      </capabilities>
4570      <parameters>
4571        <param id="heap_filter">
4572          <jint/>
4573          <description>
4574            This bit vector of
4575            <datalink id="jvmtiHeapFilter">heap filter flags</datalink>.
4576            restricts the objects for which the callback function is called.
4577            This applies to both the object and primitive callbacks.
4578          </description>
4579        </param>
4580        <param id="klass">
4581          <ptrtype>
4582            <jclass/>
4583            <nullok>callbacks are not limited to instances of a particular
4584                    class</nullok>
4585          </ptrtype>
4586          <description>
4587            Callbacks are only reported when the object is an instance of
4588            this class.
4589            Objects which are instances of a subclass of <code>klass</code>
4590            are not reported.
4591            If <code>klass</code> is an interface, no objects are reported.
4592            This applies to both the object and primitive callbacks.
4593          </description>
4594        </param>
4595        <param id="initial_object">
4596          <ptrtype>
4597            <jobject/>
4598            <nullok>references are followed from the heap roots</nullok>
4599          </ptrtype>
4600          <description>
4601            The object to follow
4602          </description>
4603        </param>
4604        <param id="callbacks">
4605          <inptr>
4606            <struct>jvmtiHeapCallbacks</struct>
4607          </inptr>
4608          <description>
4609            Structure defining the set of callback functions.
4610          </description>
4611        </param>
4612        <param id="user_data">
4613          <inbuf>
4614            <void/>
4615            <nullok><code>NULL</code> is passed as the user supplied data</nullok>
4616          </inbuf>
4617          <description>
4618            User supplied data to be passed to the callback.
4619          </description>
4620        </param>
4621      </parameters>
4622      <errors>
4623        <error id="JVMTI_ERROR_INVALID_CLASS">
4624          <paramlink id="klass"/> is not a valid class.
4625        </error>
4626        <error id="JVMTI_ERROR_INVALID_OBJECT">
4627          <paramlink id="initial_object"/> is not a valid object.
4628        </error>
4629      </errors>
4630    </function>
4631
4632
4633    <function id="IterateThroughHeap" num="116" since="1.1">
4634      <synopsis>Iterate Through Heap</synopsis>
4635      <description>
4636        Initiate an iteration over all objects in the heap.
4637        This includes both reachable and
4638        unreachable objects. Objects are visited in no particular order.
4639        <p/>
4640        Heap objects are reported by invoking the agent supplied
4641        callback function <functionlink id="jvmtiHeapIterationCallback"/>.
4642        References between objects are not reported.
4643        If only reachable objects are desired, or if object reference information
4644        is needed, use <functionlink id="FollowReferences"/>.
4645        <p/>
4646        This function can also be used to examine primitive (non-object) values.
4647        The primitive value of an array or String
4648        is reported after the object has been visited;
4649        it is reported by invoking the agent supplied callback function
4650        <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or
4651        <functionlink id="jvmtiStringPrimitiveValueCallback"/>.
4652        A primitive field
4653        is reported after the object with that field is visited;
4654        it is reported by invoking the agent supplied
4655        callback function
4656        <functionlink id="jvmtiPrimitiveFieldCallback"/>.
4657        <p/>
4658        Unless the iteration is aborted by the
4659        <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4660        returned by a callback, all objects in the heap are visited.
4661        Whether a callback is provided or is <code>NULL</code> only determines
4662        whether the callback will be invoked, it does not influence
4663        which objects are visited nor does it influence whether other callbacks
4664        will be invoked.
4665        The <datalink id="jvmtiHeapFilter">heap filter flags</datalink>
4666        and <paramlink id="klass"/> provided as parameters to this function
4667        do not control which objects are visited but they do control which
4668        objects and primitive values are reported by the callbacks.
4669        For example, if the only callback that was set is
4670        <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
4671        is set to the array of bytes class, then only arrays of byte will be
4672        reported. The table below summarizes this (contrast this with
4673        <functionlink id="FollowReferences"/>):
4674        <p/>
4675        <table>
4676          <tr>
4677            <th/>
4678            <th>
4679              Controls objects visited
4680            </th>
4681            <th>
4682              Controls objects reported
4683            </th>
4684            <th>
4685              Controls primitives reported
4686            </th>
4687          </tr>
4688          <tr>
4689            <th class="leftAligned">
4690              the
4691              <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4692              returned by <functionlink id="jvmtiHeapIterationCallback"/>
4693            </th>
4694            <td class="centered">
4695              No<br/>(unless they abort the iteration)
4696            </td>
4697            <td class="centered">
4698              No<br/>(unless they abort the iteration)
4699            </td>
4700            <td class="centered">
4701              No<br/>(unless they abort the iteration)
4702            </td>
4703          </tr>
4704          <tr>
4705            <th class="leftAligned">
4706              <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
4707              in <paramlink id="callbacks"/> set
4708            </th>
4709            <td class="centered">
4710              No
4711            </td>
4712            <td class="centered">
4713              <b>Yes</b>
4714            </td>
4715            <td class="centered">
4716              No
4717            </td>
4718          </tr>
4719          <tr>
4720            <th class="leftAligned">
4721              <paramlink id="heap_filter"/>
4722            </th>
4723            <td class="centered">
4724              No
4725            </td>
4726            <td class="centered">
4727              <b>Yes</b>
4728            </td>
4729            <td class="centered">
4730              <b>Yes</b>
4731            </td>
4732          </tr>
4733          <tr>
4734            <th class="leftAligned">
4735              <paramlink id="klass"/>
4736            </th>
4737            <td class="centered">
4738              No
4739            </td>
4740            <td class="centered">
4741              <b>Yes</b>
4742            </td>
4743            <td class="centered">
4744              <b>Yes</b>
4745            </td>
4746          </tr>
4747        </table>
4748        <p/>
4749        During the execution of this function the state of the heap
4750        does not change: no objects are allocated, no objects are
4751        garbage collected, and the state of objects (including
4752        held values) does not change.
4753        As a result, threads executing Java
4754        programming language code, threads attempting to resume the
4755        execution of Java programming language code, and threads
4756        attempting to execute JNI functions are typically stalled.
4757      </description>
4758      <origin>new</origin>
4759      <capabilities>
4760        <required id="can_tag_objects"></required>
4761      </capabilities>
4762      <parameters>
4763        <param id="heap_filter">
4764          <jint/>
4765          <description>
4766            This bit vector of
4767            <datalink id="jvmtiHeapFilter">heap filter flags</datalink>.
4768            restricts the objects for which the callback function is called.
4769            This applies to both the object and primitive callbacks.
4770          </description>
4771        </param>
4772        <param id="klass">
4773          <ptrtype>
4774            <jclass/>
4775            <nullok>callbacks are not limited to instances of a particular class</nullok>
4776          </ptrtype>
4777          <description>
4778            Callbacks are only reported when the object is an instance of
4779            this class.
4780            Objects which are instances of a subclass of <code>klass</code>
4781            are not reported.
4782            If <code>klass</code> is an interface, no objects are reported.
4783            This applies to both the object and primitive callbacks.
4784          </description>
4785        </param>
4786        <param id="callbacks">
4787          <inptr>
4788            <struct>jvmtiHeapCallbacks</struct>
4789          </inptr>
4790          <description>
4791            Structure defining the set callback functions.
4792          </description>
4793        </param>
4794        <param id="user_data">
4795          <inbuf>
4796            <void/>
4797            <nullok><code>NULL</code> is passed as the user supplied data</nullok>
4798          </inbuf>
4799          <description>
4800            User supplied data to be passed to the callback.
4801          </description>
4802        </param>
4803      </parameters>
4804      <errors>
4805        <error id="JVMTI_ERROR_INVALID_CLASS">
4806          <paramlink id="klass"/> is not a valid class.
4807        </error>
4808      </errors>
4809    </function>
4810
4811    <function id="GetTag" phase="start" num="106">
4812      <synopsis>Get Tag</synopsis>
4813      <description>
4814        Retrieve the tag associated with an object.
4815        The tag is a long value typically used to store a
4816        unique identifier or pointer to object information.
4817        The tag is set with
4818        <functionlink id="SetTag"></functionlink>.
4819        Objects for which no tags have been set return a
4820        tag value of zero.
4821      </description>
4822      <origin>new</origin>
4823      <capabilities>
4824        <required id="can_tag_objects"></required>
4825      </capabilities>
4826      <parameters>
4827        <param id="object">
4828	  <jobject/>
4829	    <description>
4830	      The object whose tag is to be retrieved.
4831	    </description>
4832	</param>
4833        <param id="tag_ptr">
4834	  <outptr><jlong/></outptr>
4835	  <description>
4836	    On return, the referenced long is set to the value
4837	    of the tag.
4838	  </description>
4839	</param>
4840      </parameters>
4841      <errors>
4842      </errors>
4843    </function>
4844
4845    <function id="SetTag" phase="start" num="107">
4846      <synopsis>Set Tag</synopsis>
4847      <description>
4848        Set the tag associated with an object.
4849        The tag is a long value typically used to store a
4850        unique identifier or pointer to object information.
4851        The tag is visible with
4852        <functionlink id="GetTag"></functionlink>.
4853      </description>
4854      <origin>new</origin>
4855      <capabilities>
4856        <required id="can_tag_objects"></required>
4857      </capabilities>
4858      <parameters>
4859        <param id="object">
4860	  <jobject/>
4861	    <description>
4862	      The object whose tag is to be set.
4863	    </description>
4864	</param>
4865        <param id="tag">
4866	  <jlong/>
4867	  <description>
4868	    The new value of the tag.
4869	  </description>
4870	</param>
4871      </parameters>
4872      <errors>
4873      </errors>
4874    </function>
4875
4876    <function id="GetObjectsWithTags" num="114">
4877      <synopsis>Get Objects With Tags</synopsis>
4878      <description>
4879	Return objects in the heap with the specified tags.
4880	The format is parallel arrays of objects and tags.
4881      </description>
4882      <origin>new</origin>
4883      <capabilities>
4884        <required id="can_tag_objects"></required>
4885      </capabilities>
4886      <parameters>
4887	<param id="tag_count">
4888	  <jint min="0"/>
4889	    <description>
4890	      Number of tags to scan for.
4891	    </description>
4892	</param>
4893	<param id="tags">
4894	  <inbuf incount="tag_count">
4895	    <jlong/>
4896	  </inbuf>
4897	    <description>
4898	      Scan for objects with these tags.
4899	      Zero is not permitted in this array.
4900	    </description>
4901	</param>
4902	<param id="count_ptr">
4903	  <outptr>
4904	    <jint/>
4905	  </outptr>
4906	    <description>
4907	      Return the number of objects with any of the tags
4908	      in <paramlink id="tags"/>.
4909	    </description>
4910	</param>
4911	<param id="object_result_ptr">
4912	  <allocbuf outcount="count_ptr">
4913	    <jobject/>
4914	    <nullok>this information is not returned</nullok>
4915	  </allocbuf>
4916	    <description>
4917	      Returns the array of objects with any of the tags
4918	      in <paramlink id="tags"/>.
4919	    </description>
4920	</param>
4921	<param id="tag_result_ptr">
4922	  <allocbuf outcount="count_ptr">
4923	    <jlong/>
4924	    <nullok>this information is not returned</nullok>
4925	  </allocbuf>
4926	    <description>
4927	      For each object in <paramlink id="object_result_ptr"/>,
4928	      return the tag at the corresponding index.
4929	    </description>
4930	</param>
4931      </parameters>
4932      <errors>
4933	<error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
4934	  Zero is present in <paramlink id="tags"></paramlink>.
4935	</error>
4936      </errors>
4937    </function>
4938
4939    <function id="ForceGarbageCollection" num="108">
4940      <synopsis>Force Garbage Collection</synopsis>
4941      <description>
4942        Force the VM to perform a garbage collection.
4943        The garbage collection is as complete as possible.
4944        This function does not cause finalizers to be run.
4945        This function does not return until the garbage collection
4946        is finished.
4947        <p/>
4948        Although garbage collection is as complete
4949        as possible there is no guarantee that all
4950        <eventlink id="ObjectFree"/>
4951        events will have been
4952        sent by the time that this function
4953        returns. In particular, an object may be
4954        prevented from being freed because it
4955        is awaiting finalization.
4956      </description>
4957      <origin>new</origin>
4958      <capabilities>
4959      </capabilities>
4960      <parameters>
4961      </parameters>
4962      <errors>
4963      </errors>
4964    </function>
4965
4966
4967  </category>
4968
4969  <category id="Heap_1_0" label="Heap (1.0)">
4970    <intro>
4971      <b>
4972        These functions and data types were introduced in the original
4973        <jvmti/> version 1.0 and have been superseded by more
4974      </b>
4975      <internallink id="Heap"><b>powerful and flexible versions</b></internallink>
4976      <b>
4977        which:
4978      </b>
4979      <ul>
4980        <li>
4981          <b>
4982            Allow access to primitive values (the value of Strings, arrays,
4983            and primitive fields)
4984          </b>
4985        </li>
4986        <li>
4987          <b>
4988            Allow the tag of the referrer to be set, thus enabling more
4989            efficient localized reference graph building
4990          </b>
4991        </li>
4992        <li>
4993          <b>
4994            Provide more extensive filtering abilities
4995          </b>
4996        </li>
4997        <li>
4998          <b>
4999            Are extensible, allowing their abilities to grow in future versions of <jvmti/>
5000          </b>
5001        </li>
5002      </ul>
5003      <p/>
5004      <b>Please use the </b>
5005      <internallink id="Heap"><b>current Heap functions</b></internallink>.
5006        <p/>
5007        <constants id="jvmtiHeapObjectFilter" label="Heap Object Filter Enumeration" kind="enum">
5008	  <constant id="JVMTI_HEAP_OBJECT_TAGGED" num="1">
5009	    Tagged objects only.
5010	  </constant>
5011	  <constant id="JVMTI_HEAP_OBJECT_UNTAGGED" num="2">
5012	    Untagged objects only.
5013	  </constant>
5014	  <constant id="JVMTI_HEAP_OBJECT_EITHER" num="3">
5015	    Either tagged or untagged objects.
5016	  </constant>
5017	</constants>
5018
5019        <constants id="jvmtiHeapRootKind" label="Heap Root Kind Enumeration" kind="enum">
5020	  <constant id="JVMTI_HEAP_ROOT_JNI_GLOBAL" num="1">
5021	    JNI global reference.
5022	  </constant>
5023	  <constant id="JVMTI_HEAP_ROOT_SYSTEM_CLASS" num="2">
5024	    System class.
5025	  </constant>
5026	  <constant id="JVMTI_HEAP_ROOT_MONITOR" num="3">
5027	    Monitor.
5028	  </constant>
5029	  <constant id="JVMTI_HEAP_ROOT_STACK_LOCAL" num="4">
5030	    Stack local.
5031	  </constant>
5032	  <constant id="JVMTI_HEAP_ROOT_JNI_LOCAL" num="5">
5033	    JNI local reference.
5034	  </constant>
5035	  <constant id="JVMTI_HEAP_ROOT_THREAD" num="6">
5036	    Thread.
5037	  </constant>
5038	  <constant id="JVMTI_HEAP_ROOT_OTHER" num="7">
5039	    Other.
5040	  </constant>
5041	</constants>
5042
5043        <constants id="jvmtiObjectReferenceKind" label="Object Reference Enumeration" kind="enum">
5044	  <constant id="JVMTI_REFERENCE_CLASS" num="1">
5045	    Reference from an object to its class.
5046	  </constant>
5047	  <constant id="JVMTI_REFERENCE_FIELD" num="2">
5048	    Reference from an object to the value of one of its instance fields.
5049	    For references of this kind the <code>referrer_index</code>
5050	    parameter to the <internallink id="jvmtiObjectReferenceCallback">
5051            jvmtiObjectReferenceCallback</internallink> is the index of the
5052 	    the instance field. The index is based on the order of all the
5053            object's fields. This includes all fields of the directly declared
5054            static and instance fields in the class, and includes all fields (both
5055            public and private) fields declared in superclasses and superinterfaces.
5056            The index is thus calculated by summing the index of the field in the directly
5057            declared class (see <functionlink id="GetClassFields"/>), with the total
5058            number of fields (both public and private) declared in all superclasses
5059            and superinterfaces. The index starts at zero.
5060	  </constant>
5061	  <constant id="JVMTI_REFERENCE_ARRAY_ELEMENT" num="3">
5062	    Reference from an array to one of its elements.
5063	    For references of this kind the <code>referrer_index</code>
5064            parameter to the <internallink id="jvmtiObjectReferenceCallback">
5065            jvmtiObjectReferenceCallback</internallink> is the array index.
5066	  </constant>
5067	  <constant id="JVMTI_REFERENCE_CLASS_LOADER" num="4">
5068	    Reference from a class to its class loader.
5069	  </constant>
5070	  <constant id="JVMTI_REFERENCE_SIGNERS" num="5">
5071	    Reference from a class to its signers array.
5072	  </constant>
5073	  <constant id="JVMTI_REFERENCE_PROTECTION_DOMAIN" num="6">
5074	    Reference from a class to its protection domain.
5075	  </constant>
5076	  <constant id="JVMTI_REFERENCE_INTERFACE" num="7">
5077	    Reference from a class to one of its interfaces.
5078	  </constant>
5079	  <constant id="JVMTI_REFERENCE_STATIC_FIELD" num="8">
5080	    Reference from a class to the value of one of its static fields.
5081	    For references of this kind the <code>referrer_index</code>
5082	    parameter to the <internallink id="jvmtiObjectReferenceCallback">
5083            jvmtiObjectReferenceCallback</internallink> is the index of the
5084 	    the static field. The index is based on the order of all the
5085            object's fields. This includes all fields of the directly declared
5086            static and instance fields in the class, and includes all fields (both
5087            public and private) fields declared in superclasses and superinterfaces.
5088            The index is thus calculated by summing the index of the field in the directly
5089            declared class (see <functionlink id="GetClassFields"/>), with the total
5090            number of fields (both public and private) declared in all superclasses
5091            and superinterfaces. The index starts at zero.
5092            Note: this definition differs from that in the <jvmti/> 1.0 Specification.
5093            <rationale>No known implementations used the 1.0 definition.</rationale>
5094	  </constant>
5095	  <constant id="JVMTI_REFERENCE_CONSTANT_POOL" num="9">
5096	    Reference from a class to a resolved entry in the constant pool.
5097	    For references of this kind the <code>referrer_index</code>
5098            parameter to the <internallink id="jvmtiObjectReferenceCallback">
5099            jvmtiObjectReferenceCallback</internallink> is the index into
5100            constant pool table of the class, starting at 1. See
5101            <vmspec chapter="4.4"/>.
5102	  </constant>
5103	</constants>
5104
5105        <constants id="jvmtiIterationControl" label="Iteration Control Enumeration" kind="enum">
5106	  <constant id="JVMTI_ITERATION_CONTINUE" num="1">
5107	    Continue the iteration.
5108            If this is a reference iteration, follow the references of this object.
5109	  </constant>
5110	  <constant id="JVMTI_ITERATION_IGNORE" num="2">
5111	    Continue the iteration.
5112            If this is a reference iteration, ignore the references of this object.
5113	  </constant>
5114	  <constant id="JVMTI_ITERATION_ABORT" num="0">
5115	    Abort the iteration.
5116	  </constant>
5117	</constants>
5118    </intro>
5119
5120    <callback id="jvmtiHeapObjectCallback">
5121      <enum>jvmtiIterationControl</enum>
5122      <synopsis>Heap Object Callback</synopsis>
5123      <description>
5124        Agent supplied callback function.
5125	Describes (but does not pass in) an object in the heap.
5126        <p/>
5127        Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5128        or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5129        <p/>
5130        See the <internallink id="heapCallbacks">heap callback
5131        function restrictions</internallink>.
5132      </description>
5133      <parameters>
5134        <param id="class_tag">
5135	  <jlong/>
5136	  <description>
5137	    The tag of the class of object (zero if the class is not tagged).
5138	    If the object represents a runtime class,
5139            the <code>class_tag</code> is the tag
5140	    associated with <code>java.lang.Class</code>
5141            (zero if <code>java.lang.Class</code> is not tagged).
5142	  </description>
5143	</param>
5144        <param id="size">
5145	  <jlong/>
5146	  <description>
5147	    Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5148	  </description>
5149	</param>
5150        <param id="tag_ptr">
5151	  <outptr><jlong/></outptr>
5152	  <description>
5153	    The object tag value, or zero if the object is not tagged.
5154	    To set the tag value to be associated with the object
5155	    the agent sets the <code>jlong</code> pointed to by the parameter.
5156	  </description>
5157	</param>
5158        <param id="user_data">
5159	  <outptr><void/></outptr>
5160	  <description>
5161	    The user supplied data that was passed into the iteration function.
5162	  </description>
5163	</param>
5164      </parameters>
5165    </callback>
5166
5167    <callback id="jvmtiHeapRootCallback">
5168      <enum>jvmtiIterationControl</enum>
5169      <synopsis>Heap Root Object Callback</synopsis>
5170      <description>
5171        Agent supplied callback function.
5172	Describes (but does not pass in) an object that is a root for the purposes
5173	of garbage collection.
5174        <p/>
5175        Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5176        <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5177        references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5178        <p/>
5179        See the <internallink id="heapCallbacks">heap callback
5180        function restrictions</internallink>.
5181      </description>
5182      <parameters>
5183	<param id="root_kind">
5184	  <enum>jvmtiHeapRootKind</enum>
5185	  <description>
5186	    The kind of heap root.
5187	  </description>
5188	</param>
5189        <param id="class_tag">
5190	  <jlong/>
5191	  <description>
5192	    The tag of the class of object (zero if the class is not tagged).
5193            If the object represents a runtime class, the <code>class_tag</code> is the tag
5194            associated with <code>java.lang.Class</code>
5195            (zero if <code>java.lang.Class</code> is not tagged).
5196	  </description>
5197	</param>
5198        <param id="size">
5199	  <jlong/>
5200	  <description>
5201	    Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5202	  </description>
5203	</param>
5204        <param id="tag_ptr">
5205	  <outptr><jlong/></outptr>
5206	  <description>
5207	    The object tag value, or zero if the object is not tagged.
5208	    To set the tag value to be associated with the object
5209	    the agent sets the <code>jlong</code> pointed to by the parameter.
5210	  </description>
5211	</param>
5212        <param id="user_data">
5213	  <outptr><void/></outptr>
5214	  <description>
5215	    The user supplied data that was passed into the iteration function.
5216	  </description>
5217	</param>
5218      </parameters>
5219    </callback>
5220
5221    <callback id="jvmtiStackReferenceCallback">
5222      <enum>jvmtiIterationControl</enum>
5223      <synopsis>Stack Reference Object Callback</synopsis>
5224      <description>
5225        Agent supplied callback function.
5226	Describes (but does not pass in) an object on the stack that is a root for
5227	the purposes of garbage collection.
5228        <p/>
5229        Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5230        <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5231        references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5232        <p/>
5233        See the <internallink id="heapCallbacks">heap callback
5234        function restrictions</internallink>.
5235      </description>
5236      <parameters>
5237	<param id="root_kind">
5238	  <enum>jvmtiHeapRootKind</enum>
5239	  <description>
5240	    The kind of root (either <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or
5241	    <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>).
5242	  </description>
5243	</param>
5244        <param id="class_tag">
5245	  <jlong/>
5246	  <description>
5247           The tag of the class of object (zero if the class is not tagged).
5248           If the object represents a runtime class, the  <code>class_tag</code> is the tag
5249           associated with <code>java.lang.Class</code>
5250           (zero if <code>java.lang.Class</code> is not tagged).
5251	  </description>
5252	</param>
5253        <param id="size">
5254	  <jlong/>
5255	  <description>
5256	    Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5257	  </description>
5258	</param>
5259        <param id="tag_ptr">
5260	  <outptr><jlong/></outptr>
5261	  <description>
5262	    The object tag value, or zero if the object is not tagged.
5263	    To set the tag value to be associated with the object
5264	    the agent sets the <code>jlong</code> pointed to by the parameter.
5265	  </description>
5266	</param>
5267        <param id="thread_tag">
5268	  <jlong/>
5269	  <description>
5270	    The tag of the thread corresponding to this stack, zero if not tagged.
5271	  </description>
5272	</param>
5273        <param id="depth">
5274	  <jint/>
5275	  <description>
5276	    The depth of the frame.
5277	  </description>
5278	</param>
5279        <param id="method">
5280	  <jmethodID/>
5281	  <description>
5282	    The method executing in this frame.
5283	  </description>
5284	</param>
5285        <param id="slot">
5286	  <jint/>
5287	  <description>
5288	    The slot number.
5289	  </description>
5290	</param>
5291        <param id="user_data">
5292	  <outptr><void/></outptr>
5293	  <description>
5294	    The user supplied data that was passed into the iteration function.
5295	  </description>
5296	</param>
5297      </parameters>
5298    </callback>
5299
5300    <callback id="jvmtiObjectReferenceCallback">
5301      <enum>jvmtiIterationControl</enum>
5302      <synopsis>Object Reference Callback</synopsis>
5303      <description>
5304        Agent supplied callback function.
5305	Describes a reference from an object (the referrer) to another object
5306	(the referree).
5307        <p/>
5308        Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5309        <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5310        references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5311        <p/>
5312        See the <internallink id="heapCallbacks">heap callback
5313        function restrictions</internallink>.
5314      </description>
5315      <parameters>
5316	<param id="reference_kind">
5317	  <enum>jvmtiObjectReferenceKind</enum>
5318	  <description>
5319	    The type of reference.
5320	  </description>
5321	</param>
5322        <param id="class_tag">
5323	  <jlong/>
5324	  <description>
5325	    The tag of the class of referree object (zero if the class is not tagged).
5326            If the referree object represents a runtime class,
5327            the  <code>class_tag</code> is the tag
5328            associated with <code>java.lang.Class</code>
5329            (zero if <code>java.lang.Class</code> is not tagged).
5330	  </description>
5331	</param>
5332        <param id="size">
5333	  <jlong/>
5334	  <description>
5335	    Size of the referree object (in bytes).
5336            See <functionlink id="GetObjectSize"/>.
5337	  </description>
5338	</param>
5339        <param id="tag_ptr">
5340	  <outptr><jlong/></outptr>
5341	  <description>
5342	    The referree object tag value, or zero if the object is not
5343	    tagged.
5344	    To set the tag value to be associated with the object
5345	    the agent sets the <code>jlong</code> pointed to by the parameter.
5346	  </description>
5347	</param>
5348        <param id="referrer_tag">
5349	  <jlong/>
5350	  <description>
5351	    The tag of the referrer object, or zero if the referrer
5352	    object is not tagged.
5353	  </description>
5354	</param>
5355	<param id="referrer_index">
5356	  <jint/>
5357	  <description>
5358	    For references of type <code>JVMTI_REFERENCE_FIELD</code> or
5359            <code>JVMTI_REFERENCE_STATIC_FIELD</code> the index
5360	    of the field in the referrer object. The index is based on the
5361	    order of all the object's fields - see <internallink
5362	    id="JVMTI_REFERENCE_FIELD">JVMTI_REFERENCE_FIELD</internallink>
5363            or <internallink
5364	    id="JVMTI_REFERENCE_STATIC_FIELD">JVMTI_REFERENCE_STATIC_FIELD
5365	    </internallink> for further description.
5366	    <p/>
5367	    For references of type <code>JVMTI_REFERENCE_ARRAY_ELEMENT</code>
5368	    the array index - see <internallink id="JVMTI_REFERENCE_ARRAY_ELEMENT">
5369	    JVMTI_REFERENCE_ARRAY_ELEMENT</internallink> for further description.
5370	    <p/>
5371	    For references of type <code>JVMTI_REFERENCE_CONSTANT_POOL</code>
5372	    the index into the constant pool of the class - see
5373	    <internallink id="JVMTI_REFERENCE_CONSTANT_POOL">
5374	    JVMTI_REFERENCE_CONSTANT_POOL</internallink> for further
5375	    description.
5376	    <p/>
5377	    For references of other kinds the <code>referrer_index</code> is
5378	    <code>-1</code>.
5379	  </description>
5380	</param>
5381        <param id="user_data">
5382	  <outptr><void/></outptr>
5383	  <description>
5384	    The user supplied data that was passed into the iteration function.
5385	  </description>
5386	</param>
5387      </parameters>
5388    </callback>
5389
5390    <function id="IterateOverObjectsReachableFromObject" num="109">
5391      <synopsis>Iterate Over Objects Reachable From Object</synopsis>
5392      <description>
5393        This function iterates over all objects that are directly
5394        and indirectly reachable from the specified object.
5395	For each object <i>A</i> (known
5396	as the referrer) with a reference to object <i>B</i> the specified
5397	callback function is called to describe the object reference.
5398        The callback is called exactly once for each reference from a referrer;
5399        this is true even if there are reference cycles or multiple paths to
5400        the referrer.
5401        There may be more than one reference between a referrer and a referree,
5402        These may be distinguished by the
5403        <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and
5404        <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>.
5405        The callback for an object will always occur after the callback for
5406        its referrer.
5407        <p/>
5408        See <functionlink id="FollowReferences"/> for the object
5409        references which are reported.
5410        <p/>
5411        During the execution of this function the state of the heap
5412        does not change: no objects are allocated, no objects are
5413        garbage collected, and the state of objects (including
5414        held values) does not change.
5415        As a result, threads executing Java
5416        programming language code, threads attempting to resume the
5417        execution of Java programming language code, and threads
5418        attempting to execute JNI functions are typically stalled.
5419      </description>
5420      <origin>new</origin>
5421      <capabilities>
5422        <required id="can_tag_objects"></required>
5423      </capabilities>
5424      <parameters>
5425        <param id="object">
5426	  <jobject/>
5427	    <description>
5428	      The object
5429	    </description>
5430	</param>
5431        <param id="object_reference_callback">
5432	  <ptrtype>
5433	    <struct>jvmtiObjectReferenceCallback</struct>
5434	  </ptrtype>
5435	    <description>
5436	      The callback to be called to describe each
5437	      object reference.
5438	    </description>
5439	</param>
5440        <param id="user_data">
5441	  <inbuf>
5442	    <void/>
5443	    <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5444	  </inbuf>
5445	  <description>
5446	    User supplied data to be passed to the callback.
5447	  </description>
5448	</param>
5449      </parameters>
5450      <errors>
5451      </errors>
5452    </function>
5453
5454    <function id="IterateOverReachableObjects" num="110">
5455      <synopsis>Iterate Over Reachable Objects</synopsis>
5456      <description>
5457        This function iterates over the root objects and all objects that
5458        are directly and indirectly reachable from the root objects.
5459	The root objects comprise the set of system classes,
5460	JNI globals, references from thread stacks, and other objects used as roots
5461	for the purposes of garbage collection.
5462	<p/>
5463	For each root the <paramlink id="heap_root_callback"></paramlink>
5464	or <paramlink id="stack_ref_callback"></paramlink> callback is called.
5465	An object can be a root object for more than one reason and in that case
5466	the appropriate callback is called for each reason.
5467	<p/>
5468	For each object reference the <paramlink id="object_ref_callback"></paramlink>
5469	callback function is called to describe the object reference.
5470        The callback is called exactly once for each reference from a referrer;
5471        this is true even if there are reference cycles or multiple paths to
5472        the referrer.
5473        There may be more than one reference between a referrer and a referree,
5474        These may be distinguished by the
5475        <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and
5476        <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>.
5477        The callback for an object will always occur after the callback for
5478        its referrer.
5479        <p/>
5480        See <functionlink id="FollowReferences"/> for the object
5481        references which are reported.
5482	<p/>
5483	Roots are always reported to the profiler before any object references
5484	are reported. In other words, the <paramlink id="object_ref_callback"></paramlink>
5485	callback will not be called until the appropriate callback has been called
5486	for all roots. If the <paramlink id="object_ref_callback"></paramlink> callback is
5487	specified as <code>NULL</code> then this function returns after
5488	reporting the root objects to the profiler.
5489        <p/>
5490        During the execution of this function the state of the heap
5491        does not change: no objects are allocated, no objects are
5492        garbage collected, and the state of objects (including
5493        held values) does not change.
5494        As a result, threads executing Java
5495        programming language code, threads attempting to resume the
5496        execution of Java programming language code, and threads
5497        attempting to execute JNI functions are typically stalled.
5498      </description>
5499      <origin>new</origin>
5500      <capabilities>
5501        <required id="can_tag_objects"></required>
5502      </capabilities>
5503      <parameters>
5504        <param id="heap_root_callback">
5505	  <ptrtype>
5506	    <struct>jvmtiHeapRootCallback</struct>
5507	    <nullok>do not report heap roots</nullok>
5508	  </ptrtype>
5509	    <description>
5510	      The callback function to be called for each heap root of type
5511	      <code>JVMTI_HEAP_ROOT_JNI_GLOBAL</code>,
5512	      <code>JVMTI_HEAP_ROOT_SYSTEM_CLASS</code>,
5513	      <code>JVMTI_HEAP_ROOT_MONITOR</code>,
5514	      <code>JVMTI_HEAP_ROOT_THREAD</code>, or
5515	      <code>JVMTI_HEAP_ROOT_OTHER</code>.
5516	    </description>
5517	</param>
5518        <param id="stack_ref_callback">
5519	  <ptrtype>
5520	    <struct>jvmtiStackReferenceCallback</struct>
5521	    <nullok>do not report stack references</nullok>
5522	  </ptrtype>
5523	    <description>
5524	      The callback function to be called for each heap root of
5525	      <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or
5526	      <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>.
5527	    </description>
5528	</param>
5529        <param id="object_ref_callback">
5530	  <ptrtype>
5531	    <struct>jvmtiObjectReferenceCallback</struct>
5532	    <nullok>do not follow references from the root objects</nullok>
5533	  </ptrtype>
5534	    <description>
5535	      The callback function to be called for each object reference.
5536	    </description>
5537	</param>
5538        <param id="user_data">
5539	  <inbuf>
5540	    <void/>
5541	    <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5542	  </inbuf>
5543	  <description>
5544	    User supplied data to be passed to the callback.
5545	  </description>
5546	</param>
5547      </parameters>
5548      <errors>
5549      </errors>
5550    </function>
5551
5552    <function id="IterateOverHeap" num="111">
5553      <synopsis>Iterate Over Heap</synopsis>
5554      <description>
5555        Iterate over all objects in the heap. This includes both reachable and
5556	unreachable objects.
5557	<p/>
5558	The <paramlink id="object_filter"></paramlink> parameter indicates the
5559	objects for which the callback function is called. If this parameter
5560	is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be
5561	called for every object that is tagged. If the parameter is
5562	<code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be
5563	for objects that are not tagged. If the parameter
5564	is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be
5565	called for every object in the heap, irrespective of whether it is
5566	tagged or not.
5567        <p/>
5568        During the execution of this function the state of the heap
5569        does not change: no objects are allocated, no objects are
5570        garbage collected, and the state of objects (including
5571        held values) does not change.
5572        As a result, threads executing Java
5573        programming language code, threads attempting to resume the
5574        execution of Java programming language code, and threads
5575        attempting to execute JNI functions are typically stalled.
5576      </description>
5577      <origin>new</origin>
5578      <capabilities>
5579        <required id="can_tag_objects"></required>
5580      </capabilities>
5581      <parameters>
5582	<param id="object_filter">
5583	  <enum>jvmtiHeapObjectFilter</enum>
5584	  <description>
5585	    Indicates the objects for which the callback function is called.
5586	  </description>
5587	</param>
5588        <param id="heap_object_callback">
5589	  <ptrtype>
5590	    <struct>jvmtiHeapObjectCallback</struct>
5591	  </ptrtype>
5592	    <description>
5593	      The iterator function to be called for each
5594	      object matching the <paramlink id="object_filter"/>.
5595	    </description>
5596	</param>
5597        <param id="user_data">
5598	  <inbuf>
5599	    <void/>
5600	    <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5601	  </inbuf>
5602	  <description>
5603	    User supplied data to be passed to the callback.
5604	  </description>
5605	</param>
5606      </parameters>
5607      <errors>
5608      </errors>
5609    </function>
5610
5611    <function id="IterateOverInstancesOfClass" num="112">
5612      <synopsis>Iterate Over Instances Of Class</synopsis>
5613      <description>
5614        Iterate over all objects in the heap that are instances of the specified class.
5615        This includes direct instances of the specified class and
5616        instances of all subclasses of the specified class.
5617	This includes both reachable and unreachable objects.
5618	<p/>
5619	The <paramlink id="object_filter"></paramlink> parameter indicates the
5620	objects for which the callback function is called. If this parameter
5621	is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be
5622	called for every object that is tagged. If the parameter is
5623	<code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be
5624	called for objects that are not tagged. If the parameter
5625	is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be
5626	called for every object in the heap, irrespective of whether it is
5627	tagged or not.
5628	<p/>
5629	During the execution of this function the state of the heap
5630	does not change: no objects are allocated, no objects are
5631	garbage collected, and the state of objects (including
5632	held values) does not change.
5633	As a result, threads executing Java
5634	programming language code, threads attempting to resume the
5635	execution of Java programming language code, and threads
5636	attempting to execute JNI functions are typically stalled.
5637      </description>
5638      <origin>new</origin>
5639      <capabilities>
5640        <required id="can_tag_objects"></required>
5641      </capabilities>
5642      <parameters>
5643	<param id="klass">
5644	  <jclass/>
5645	    <description>
5646	      Iterate over objects of this class only.
5647	    </description>
5648	</param>
5649	<param id="object_filter">
5650	  <enum>jvmtiHeapObjectFilter</enum>
5651	  <description>
5652	    Indicates the objects for which the callback function is called.
5653	  </description>
5654	</param>
5655	<param id="heap_object_callback">
5656	  <ptrtype>
5657	    <struct>jvmtiHeapObjectCallback</struct>
5658	  </ptrtype>
5659	    <description>
5660	      The iterator function to be called for each
5661	      <paramlink id="klass"/> instance matching
5662              the <paramlink id="object_filter"/>.
5663	    </description>
5664	</param>
5665        <param id="user_data">
5666	  <inbuf>
5667	    <void/>
5668	    <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5669	  </inbuf>
5670	  <description>
5671	    User supplied data to be passed to the callback.
5672	  </description>
5673	</param>
5674      </parameters>
5675      <errors>
5676      </errors>
5677    </function>
5678
5679  </category>
5680
5681  <category id="local" label="Local Variable">
5682
5683    <intro>
5684      These functions are used to retrieve or set the value of a local variable.
5685      The variable is identified by the depth of the frame containing its
5686      value and the variable's slot number within that frame.
5687      The mapping of variables to
5688      slot numbers can be obtained with the function
5689      <functionlink id="GetLocalVariableTable"></functionlink>.
5690    </intro>
5691
5692    <function id="GetLocalObject" num="21">
5693      <synopsis>Get Local Variable - Object</synopsis>
5694      <description>
5695	This function can be used to retrieve the value of a local
5696        variable whose type is <code>Object</code> or a subclass of <code>Object</code>.
5697      </description>
5698      <origin>jvmdi</origin>
5699      <capabilities>
5700	<required id="can_access_local_variables"></required>
5701      </capabilities>
5702      <parameters>
5703 	<param id="thread">
5704	  <jthread null="current" frame="frame"/>
5705	  <description>
5706	    The thread of the frame containing the variable's value.
5707	  </description>
5708	</param>
5709	<param id="depth">
5710	  <jframeID thread="thread"/>
5711	  <description>
5712	    The depth of the frame containing the variable's value.
5713	  </description>
5714	</param>
5715	<param id="slot">
5716	  <jint/>
5717	  <description>
5718	    The variable's slot number.
5719	  </description>
5720	</param>
5721	<param id="value_ptr">
5722	  <outptr><jobject/></outptr>
5723	    <description>
5724	      On return, points to the variable's value.
5725	    </description>
5726	</param>
5727      </parameters>
5728      <errors>
5729	<error id="JVMTI_ERROR_INVALID_SLOT">
5730	  Invalid <code>slot</code>.
5731	</error>
5732	<error id="JVMTI_ERROR_TYPE_MISMATCH">
5733          The variable type is not
5734          <code>Object</code> or a subclass of <code>Object</code>.
5735	</error>
5736	<error id="JVMTI_ERROR_OPAQUE_FRAME">
5737	  Not a visible frame
5738	</error>
5739      </errors>
5740    </function>
5741
5742    <function id="GetLocalInstance" num="155" since="1.2">
5743      <synopsis>Get Local Instance</synopsis>
5744      <description>
5745        This function can be used to retrieve the value of the local object
5746        variable at slot 0 (the "<code>this</code>" object) from non-static
5747        frames.  This function can retrieve the "<code>this</code>" object from
5748        native method frames, whereas <code>GetLocalObject()</code> would
5749        return <code>JVMTI_ERROR_OPAQUE_FRAME</code> in those cases.
5750      </description>
5751      <origin>new</origin>
5752      <capabilities>
5753	<required id="can_access_local_variables"></required>
5754      </capabilities>
5755      <parameters>
5756 	<param id="thread">
5757	  <jthread null="current" frame="frame"/>
5758	  <description>
5759	    The thread of the frame containing the variable's value.
5760	  </description>
5761	</param>
5762	<param id="depth">
5763	  <jframeID thread="thread"/>
5764	  <description>
5765	    The depth of the frame containing the variable's value.
5766	  </description>
5767	</param>
5768	<param id="value_ptr">
5769	  <outptr><jobject/></outptr>
5770	    <description>
5771	      On return, points to the variable's value.
5772	    </description>
5773	</param>
5774      </parameters>
5775      <errors>
5776	<error id="JVMTI_ERROR_INVALID_SLOT">
5777	  If the specified frame is a static method frame.
5778	</error>
5779      </errors>
5780    </function>
5781    <function id="GetLocalInt" num="22">
5782      <synopsis>Get Local Variable - Int</synopsis>
5783      <description>
5784	This function can be used to retrieve the value of a local
5785        variable whose type is <code>int</code>,
5786        <code>short</code>, <code>char</code>, <code>byte</code>, or
5787	<code>boolean</code>.
5788      </description>
5789      <origin>jvmdi</origin>
5790      <capabilities>
5791	<required id="can_access_local_variables"></required>
5792      </capabilities>
5793      <parameters>
5794 	<param id="thread">
5795	  <jthread null="current" frame="frame"/>
5796	  <description>
5797	    The thread of the frame containing the variable's value.
5798	  </description>
5799	</param>
5800	<param id="depth">
5801	  <jframeID thread="thread"/>
5802	  <description>
5803	    The depth of the frame containing the variable's value.
5804	  </description>
5805	</param>
5806	<param id="slot">
5807	  <jint/>
5808	  <description>
5809	    The variable's slot number.
5810	  </description>
5811	</param>
5812	<param id="value_ptr">
5813	  <outptr><jint/></outptr>
5814	  <description>
5815	    On return, points to the variable's value.
5816	  </description>
5817	</param>
5818      </parameters>
5819      <errors>
5820	<error id="JVMTI_ERROR_INVALID_SLOT">
5821	  Invalid <code>slot</code>.
5822	</error>
5823	<error id="JVMTI_ERROR_TYPE_MISMATCH">
5824	  The variable type is not
5825          <code>int</code>, <code>short</code>,
5826          <code>char</code>, <code>byte</code>, or
5827  	  <code>boolean</code>.
5828	</error>
5829	<error id="JVMTI_ERROR_OPAQUE_FRAME">
5830	  Not a visible frame
5831	</error>
5832      </errors>
5833    </function>
5834
5835    <function id="GetLocalLong" num="23">
5836      <synopsis>Get Local Variable - Long</synopsis>
5837      <description>
5838	This function can be used to retrieve the value of a local
5839        variable whose type is <code>long</code>.
5840      </description>
5841      <origin>jvmdi</origin>
5842      <capabilities>
5843	<required id="can_access_local_variables"></required>
5844      </capabilities>
5845      <parameters>
5846 	<param id="thread">
5847	  <jthread null="current" frame="frame"/>
5848	  <description>
5849	    The thread of the frame containing the variable's value.
5850	  </description>
5851	</param>
5852	<param id="depth">
5853	  <jframeID thread="thread"/>
5854	  <description>
5855	    The depth of the frame containing the variable's value.
5856	  </description>
5857	</param>
5858	<param id="slot">
5859	  <jint/>
5860	  <description>
5861	    The variable's slot number.
5862	  </description>
5863	</param>
5864	<param id="value_ptr">
5865	  <outptr><jlong/></outptr>
5866	  <description>
5867	    On return, points to the variable's value.
5868	  </description>
5869	</param>
5870      </parameters>
5871      <errors>
5872	<error id="JVMTI_ERROR_INVALID_SLOT">
5873	  Invalid <code>slot</code>.
5874	</error>
5875	<error id="JVMTI_ERROR_TYPE_MISMATCH">
5876	  The variable type is not <code>long</code>.
5877	</error>
5878	<error id="JVMTI_ERROR_OPAQUE_FRAME">
5879	  Not a visible frame
5880	</error>
5881      </errors>
5882    </function>
5883
5884    <function id="GetLocalFloat" num="24">
5885      <synopsis>Get Local Variable - Float</synopsis>
5886      <description>
5887	This function can be used to retrieve the value of a local
5888        variable whose type is <code>float</code>.
5889      </description>
5890      <origin>jvmdi</origin>
5891      <capabilities>
5892	<required id="can_access_local_variables"></required>
5893      </capabilities>
5894      <parameters>
5895 	<param id="thread">
5896	  <jthread null="current" frame="frame"/>
5897	  <description>
5898	    The thread of the frame containing the variable's value.
5899	  </description>
5900	</param>
5901	<param id="depth">
5902	  <jframeID thread="thread"/>
5903	  <description>
5904	    The depth of the frame containing the variable's value.
5905	  </description>
5906	</param>
5907	<param id="slot">
5908	  <jint/>
5909	  <description>
5910	    The variable's slot number.
5911	  </description>
5912	</param>
5913	<param id="value_ptr">
5914	  <outptr><jfloat/></outptr>
5915	  <description>
5916	    On return, points to the variable's value.
5917	  </description>
5918	</param>
5919      </parameters>
5920      <errors>
5921	<error id="JVMTI_ERROR_INVALID_SLOT">
5922	  Invalid <code>slot</code>.
5923	</error>
5924	<error id="JVMTI_ERROR_TYPE_MISMATCH">
5925	  The variable type is not <code>float</code>.
5926	</error>
5927	<error id="JVMTI_ERROR_OPAQUE_FRAME">
5928	  Not a visible frame
5929	</error>
5930      </errors>
5931    </function>
5932
5933    <function id="GetLocalDouble" num="25">
5934      <synopsis>Get Local Variable - Double</synopsis>
5935      <description>
5936	This function can be used to retrieve the value of a local
5937        variable whose type is <code>long</code>.
5938      </description>
5939      <origin>jvmdi</origin>
5940      <capabilities>
5941	<required id="can_access_local_variables"></required>
5942      </capabilities>
5943      <parameters>
5944 	<param id="thread">
5945	  <jthread null="current" frame="frame"/>
5946	  <description>
5947	    The thread of the frame containing the variable's value.
5948	  </description>
5949	</param>
5950	<param id="depth">
5951	  <jframeID thread="thread"/>
5952	  <description>
5953	    The depth of the frame containing the variable's value.
5954	  </description>
5955	</param>
5956	<param id="slot">
5957	  <jint/>
5958	  <description>
5959	    The variable's slot number.
5960	  </description>
5961	</param>
5962	<param id="value_ptr">
5963	  <outptr><jdouble/></outptr>
5964	  <description>
5965	    On return, points to the variable's value.
5966	  </description>
5967	</param>
5968      </parameters>
5969      <errors>
5970	<error id="JVMTI_ERROR_INVALID_SLOT">
5971	  Invalid <code>slot</code>.
5972	</error>
5973	<error id="JVMTI_ERROR_TYPE_MISMATCH">
5974	  The variable type is not <code>double</code>.
5975	</error>
5976	<error id="JVMTI_ERROR_OPAQUE_FRAME">
5977	  Not a visible frame
5978	</error>
5979      </errors>
5980    </function>
5981
5982    <function id="SetLocalObject" num="26">
5983      <synopsis>Set Local Variable - Object</synopsis>
5984      <description>
5985	This function can be used to set the value of a local
5986        variable whose type is <code>Object</code> or a subclass of <code>Object</code>.
5987      </description>
5988      <origin>jvmdi</origin>
5989      <capabilities>
5990	<required id="can_access_local_variables"></required>
5991      </capabilities>
5992      <parameters>
5993 	<param id="thread">
5994	  <jthread null="current" frame="frame"/>
5995	  <description>
5996	    The thread of the frame containing the variable's value.
5997	  </description>
5998	</param>
5999	<param id="depth">
6000	  <jframeID thread="thread"/>
6001	  <description>
6002	    The depth of the frame containing the variable's value.
6003	  </description>
6004	</param>
6005	<param id="slot">
6006	  <jint/>
6007	  <description>
6008	    The variable's slot number.
6009	  </description>
6010	</param>
6011	<param id="value">
6012	  <jobject/>
6013	    <description>
6014	      The new value for the variable.
6015	    </description>
6016	</param>
6017      </parameters>
6018      <errors>
6019	<error id="JVMTI_ERROR_INVALID_SLOT">
6020	  Invalid <code>slot</code>.
6021	</error>
6022	<error id="JVMTI_ERROR_TYPE_MISMATCH">
6023	  The variable type is not
6024	  <code>Object</code> or a subclass of <code>Object</code>.
6025	</error>
6026	<error id="JVMTI_ERROR_TYPE_MISMATCH">
6027	  The supplied <paramlink id="value"/> is not compatible
6028	  with the variable type.
6029	</error>
6030	<error id="JVMTI_ERROR_OPAQUE_FRAME">
6031	  Not a visible frame
6032	</error>
6033      </errors>
6034    </function>
6035
6036    <function id="SetLocalInt" num="27">
6037      <synopsis>Set Local Variable - Int</synopsis>
6038      <description>
6039	This function can be used to set the value of a local
6040        variable whose type is <code>int</code>,
6041        <code>short</code>, <code>char</code>, <code>byte</code>, or
6042	<code>boolean</code>.
6043      </description>
6044      <origin>jvmdi</origin>
6045      <capabilities>
6046	<required id="can_access_local_variables"></required>
6047      </capabilities>
6048      <parameters>
6049 	<param id="thread">
6050	  <jthread null="current" frame="frame"/>
6051	  <description>
6052	    The thread of the frame containing the variable's value.
6053	  </description>
6054	</param>
6055	<param id="depth">
6056	  <jframeID thread="thread"/>
6057	  <description>
6058	    The depth of the frame containing the variable's value.
6059	  </description>
6060	</param>
6061	<param id="slot">
6062	  <jint/>
6063	  <description>
6064	    The variable's slot number.
6065	  </description>
6066	</param>
6067	<param id="value">
6068	  <jint/>
6069	  <description>
6070	    The new value for the variable.
6071	  </description>
6072	</param>
6073      </parameters>
6074      <errors>
6075	<error id="JVMTI_ERROR_INVALID_SLOT">
6076	  Invalid <code>slot</code>.
6077	</error>
6078	<error id="JVMTI_ERROR_TYPE_MISMATCH">
6079	  The variable type is not
6080          <code>int</code>, <code>short</code>,
6081          <code>char</code>, <code>byte</code>, or
6082  	  <code>boolean</code>.
6083	</error>
6084	<error id="JVMTI_ERROR_OPAQUE_FRAME">
6085	  Not a visible frame
6086	</error>
6087      </errors>
6088    </function>
6089
6090    <function id="SetLocalLong" num="28">
6091      <synopsis>Set Local Variable - Long</synopsis>
6092      <description>
6093	This function can be used to set the value of a local
6094        variable whose type is <code>long</code>.
6095      </description>
6096      <origin>jvmdi</origin>
6097      <capabilities>
6098	<required id="can_access_local_variables"></required>
6099      </capabilities>
6100      <parameters>
6101 	<param id="thread">
6102	  <jthread null="current" frame="frame"/>
6103	  <description>
6104	    The thread of the frame containing the variable's value.
6105	  </description>
6106	</param>
6107	<param id="depth">
6108	  <jframeID thread="thread"/>
6109	  <description>
6110	    The depth of the frame containing the variable's value.
6111	  </description>
6112	</param>
6113	<param id="slot">
6114	  <jint/>
6115	  <description>
6116	    The variable's slot number.
6117	  </description>
6118	</param>
6119	<param id="value">
6120	  <jlong/>
6121	  <description>
6122	    The new value for the variable.
6123	  </description>
6124	</param>
6125      </parameters>
6126      <errors>
6127	<error id="JVMTI_ERROR_INVALID_SLOT">
6128	  Invalid <code>slot</code>.
6129	</error>
6130	<error id="JVMTI_ERROR_TYPE_MISMATCH">
6131	  The variable type is not <code>long</code>.
6132	</error>
6133	<error id="JVMTI_ERROR_OPAQUE_FRAME">
6134	  Not a visible frame
6135	</error>
6136      </errors>
6137    </function>
6138
6139    <function id="SetLocalFloat" num="29">
6140      <synopsis>Set Local Variable - Float</synopsis>
6141      <description>
6142	This function can be used to set the value of a local
6143        variable whose type is <code>float</code>.
6144      </description>
6145      <origin>jvmdi</origin>
6146      <capabilities>
6147	<required id="can_access_local_variables"></required>
6148      </capabilities>
6149      <parameters>
6150 	<param id="thread">
6151	  <jthread null="current" frame="frame"/>
6152	  <description>
6153	    The thread of the frame containing the variable's value.
6154	  </description>
6155	</param>
6156	<param id="depth">
6157	  <jframeID thread="thread"/>
6158	  <description>
6159	    The depth of the frame containing the variable's value.
6160	  </description>
6161	</param>
6162	<param id="slot">
6163	  <jint/>
6164	  <description>
6165	    The variable's slot number.
6166	  </description>
6167	</param>
6168	<param id="value">
6169	  <jfloat/>
6170	  <description>
6171	    The new value for the variable.
6172	  </description>
6173	</param>
6174      </parameters>
6175      <errors>
6176	<error id="JVMTI_ERROR_INVALID_SLOT">
6177	  Invalid <code>slot</code>.
6178	</error>
6179	<error id="JVMTI_ERROR_TYPE_MISMATCH">
6180	  The variable type is not <code>float</code>.
6181	</error>
6182	<error id="JVMTI_ERROR_OPAQUE_FRAME">
6183	  Not a visible frame
6184	</error>
6185      </errors>
6186    </function>
6187
6188    <function id="SetLocalDouble" num="30">
6189      <synopsis>Set Local Variable - Double</synopsis>
6190      <description>
6191	This function can be used to set the value of a local
6192        variable whose type is <code>double</code>.
6193      </description>
6194      <origin>jvmdi</origin>
6195      <capabilities>
6196	<required id="can_access_local_variables"></required>
6197      </capabilities>
6198      <parameters>
6199 	<param id="thread">
6200	  <jthread null="current" frame="frame"/>
6201	  <description>
6202	    The thread of the frame containing the variable's value.
6203	  </description>
6204	</param>
6205	<param id="depth">
6206	  <jframeID thread="thread"/>
6207	  <description>
6208	    The depth of the frame containing the variable's value.
6209	  </description>
6210	</param>
6211	<param id="slot">
6212	  <jint/>
6213	  <description>
6214	    The variable's slot number.
6215	  </description>
6216	</param>
6217	<param id="value">
6218	  <jdouble/>
6219	  <description>
6220	    The new value for the variable.
6221	  </description>
6222	</param>
6223      </parameters>
6224      <errors>
6225	<error id="JVMTI_ERROR_INVALID_SLOT">
6226	  Invalid <code>slot</code>.
6227	</error>
6228	<error id="JVMTI_ERROR_TYPE_MISMATCH">
6229	  The variable type is not <code>double</code>.
6230	</error>
6231	<error id="JVMTI_ERROR_OPAQUE_FRAME">
6232	  Not a visible frame
6233	</error>
6234      </errors>
6235    </function>
6236  </category>
6237
6238  <category id="breakpointCategory" label="Breakpoint">
6239
6240    <intro>
6241    </intro>
6242
6243    <function id="SetBreakpoint" num="38">
6244      <synopsis>Set Breakpoint</synopsis>
6245      <description>
6246	Set a breakpoint at the instruction indicated by
6247	<code>method</code> and <code>location</code>.
6248	An instruction can only have one breakpoint.
6249	<p/>
6250	Whenever the designated instruction is about to be executed, a
6251	<eventlink id="Breakpoint"></eventlink> event is generated.
6252      </description>
6253      <origin>jvmdi</origin>
6254      <capabilities>
6255	<required id="can_generate_breakpoint_events"></required>
6256      </capabilities>
6257      <parameters>
6258	<param id="klass">
6259	  <jclass method="method"/>
6260	    <description>
6261	      The class in which to set the breakpoint
6262	    </description>
6263	</param>
6264	<param id="method">
6265	  <jmethodID class="klass"/>
6266	    <description>
6267	      The method in which to set the breakpoint
6268	    </description>
6269	</param>
6270	<param id="location">
6271	  <jlocation/>
6272	  <description>
6273	    the index of the instruction at which to set the breakpoint
6274
6275	  </description>
6276	</param>
6277      </parameters>
6278      <errors>
6279	<error id="JVMTI_ERROR_DUPLICATE">
6280	  The designated bytecode already has a breakpoint.
6281	</error>
6282      </errors>
6283    </function>
6284
6285    <function id="ClearBreakpoint" num="39">
6286      <synopsis>Clear Breakpoint</synopsis>
6287      <description>
6288	Clear the breakpoint at the bytecode indicated by
6289	<code>method</code> and <code>location</code>.
6290      </description>
6291      <origin>jvmdi</origin>
6292      <capabilities>
6293	<required id="can_generate_breakpoint_events"></required>
6294      </capabilities>
6295      <parameters>
6296	<param id="klass">
6297	  <jclass method="method"/>
6298	    <description>
6299	      The class in which to clear the breakpoint
6300	    </description>
6301	</param>
6302	<param id="method">
6303	  <jmethodID class="klass"/>
6304	    <description>
6305	      The method in which to clear the breakpoint
6306	    </description>
6307	</param>
6308	<param id="location">
6309	  <jlocation/>
6310	  <description>
6311	    the index of the instruction at which to clear the breakpoint
6312	  </description>
6313	</param>
6314      </parameters>
6315      <errors>
6316	<error id="JVMTI_ERROR_NOT_FOUND">
6317	  There's no breakpoint at the designated bytecode.
6318	</error>
6319      </errors>
6320    </function>
6321
6322  </category>
6323
6324  <category id="fieldWatch" label="Watched Field">
6325
6326    <intro>
6327    </intro>
6328
6329    <function id="SetFieldAccessWatch" num="41">
6330      <synopsis>Set Field Access Watch</synopsis>
6331      <description>
6332	Generate a <eventlink id="FieldAccess"></eventlink> event
6333	when the field specified
6334	by <code>klass</code> and
6335	<code>field</code> is about to be accessed.
6336	An event will be generated for each access of the field
6337	until it is canceled with
6338	<functionlink id="ClearFieldAccessWatch"></functionlink>.
6339	Field accesses from Java programming language code or from JNI code are watched,
6340	fields modified by other means are not watched.
6341	Note that <jvmti/> users should be aware that their own field accesses
6342	will trigger the watch.
6343	A field can only have one field access watch set.
6344	Modification of a field is not considered an access--use
6345	<functionlink id="SetFieldModificationWatch"></functionlink>
6346	to monitor modifications.
6347      </description>
6348      <origin>jvmdi</origin>
6349      <capabilities>
6350	<required id="can_generate_field_access_events"></required>
6351      </capabilities>
6352      <parameters>
6353	<param id="klass">
6354	  <jclass field="field"/>
6355	    <description>
6356	      The class containing the field to watch
6357	    </description>
6358	</param>
6359	<param id="field">
6360	  <jfieldID class="klass"/>
6361	    <description>
6362	      The field to watch
6363
6364	    </description>
6365	</param>
6366      </parameters>
6367      <errors>
6368	<error id="JVMTI_ERROR_DUPLICATE">
6369	  The designated field is already being watched for accesses.
6370	</error>
6371      </errors>
6372    </function>
6373
6374    <function id="ClearFieldAccessWatch" num="42">
6375      <synopsis>Clear Field Access Watch</synopsis>
6376      <description>
6377	Cancel a field access watch previously set by
6378	<functionlink id="SetFieldAccessWatch"></functionlink>, on the
6379	field specified
6380	by <code>klass</code> and
6381	<code>field</code>.
6382      </description>
6383      <origin>jvmdi</origin>
6384      <capabilities>
6385	<required id="can_generate_field_access_events"></required>
6386      </capabilities>
6387      <parameters>
6388	<param id="klass">
6389	  <jclass field="field"/>
6390	    <description>
6391	      The class containing the field to watch
6392	    </description>
6393	</param>
6394	<param id="field">
6395	  <jfieldID class="klass"/>
6396	    <description>
6397	      The field to watch
6398
6399	    </description>
6400	</param>
6401      </parameters>
6402      <errors>
6403	<error id="JVMTI_ERROR_NOT_FOUND">
6404	  The designated field is not being watched for accesses.
6405	</error>
6406      </errors>
6407    </function>
6408
6409    <function id="SetFieldModificationWatch" num="43">
6410      <synopsis>Set Field Modification Watch</synopsis>
6411      <description>
6412	Generate a <eventlink id="FieldModification"></eventlink> event
6413	when the field specified
6414	by <code>klass</code> and
6415	<code>field</code> is about to be modified.
6416	An event will be generated for each modification of the field
6417	until it is canceled with
6418	<functionlink id="ClearFieldModificationWatch"></functionlink>.
6419	Field modifications from Java programming language code or from JNI code are watched,
6420	fields modified by other means are not watched.
6421	Note that <jvmti/> users should be aware that their own field modifications
6422	will trigger the watch.
6423	A field can only have one field modification watch set.
6424      </description>
6425      <origin>jvmdi</origin>
6426      <capabilities>
6427	<required id="can_generate_field_modification_events"></required>
6428      </capabilities>
6429      <parameters>
6430	<param id="klass">
6431	  <jclass field="field"/>
6432	    <description>
6433	      The class containing the field to watch
6434	    </description>
6435	</param>
6436	<param id="field">
6437	  <jfieldID class="klass"/>
6438	    <description>
6439	      The field to watch
6440
6441	    </description>
6442	</param>
6443      </parameters>
6444      <errors>
6445	<error id="JVMTI_ERROR_DUPLICATE">
6446	  The designated field is already being watched for modifications.
6447	</error>
6448      </errors>
6449    </function>
6450
6451    <function id="ClearFieldModificationWatch" num="44">
6452      <synopsis>Clear Field Modification Watch</synopsis>
6453      <description>
6454
6455	Cancel a field modification watch previously set by
6456	<functionlink id="SetFieldModificationWatch"></functionlink>, on the
6457	field specified
6458	by <code>klass</code> and
6459	<code>field</code>.
6460      </description>
6461      <origin>jvmdi</origin>
6462      <capabilities>
6463	<required id="can_generate_field_modification_events"></required>
6464      </capabilities>
6465      <parameters>
6466	<param id="klass">
6467	  <jclass field="field"/>
6468	    <description>
6469	      The class containing the field to watch
6470	    </description>
6471	</param>
6472	<param id="field">
6473	  <jfieldID class="klass"/>
6474	    <description>
6475	      The field to watch
6476
6477	    </description>
6478	</param>
6479      </parameters>
6480      <errors>
6481	<error id="JVMTI_ERROR_NOT_FOUND">
6482	  The designated field is not being watched for modifications.
6483	</error>
6484      </errors>
6485    </function>
6486  </category>
6487
6488  <category id="module" label="Module">
6489
6490    <intro>
6491    </intro>
6492
6493    <function id="GetAllModules" num="3" since="9">
6494      <synopsis>Get All Modules</synopsis>
6495      <description>
6496	Return an array of all modules loaded in the virtual machine.
6497        The array includes the unnamed module for each class loader.
6498	The number of modules in the array is returned via
6499	<code>module_count_ptr</code>, and the array itself via
6500	<code>modules_ptr</code>.
6501	<p/>
6502      </description>
6503      <origin>new</origin>
6504      <capabilities>
6505      </capabilities>
6506      <parameters>
6507	<param id="module_count_ptr">
6508	  <outptr><jint/></outptr>
6509	  <description>
6510	    On return, points to the number of returned modules.
6511	  </description>
6512	</param>
6513	<param id="modules_ptr">
6514	  <allocbuf outcount="module_count_ptr"><jobject/></allocbuf>
6515	    <description>
6516	      On return, points to an array of references, one
6517              for each module.
6518	    </description>
6519	</param>
6520      </parameters>
6521      <errors>
6522      </errors>
6523    </function>
6524
6525    <function id="GetNamedModule" num="40" since="9">
6526      <synopsis>Get Named Module</synopsis>
6527      <description>
6528        Return the <code>java.lang.Module</code> object for a named
6529        module defined to a class loader that contains a given package.
6530        The module is returned via <code>module_ptr</code>.
6531        <p/>
6532        If a named module is defined to the class loader and it
6533        contains the package then that named module is returned,
6534        otherwise <code>NULL</code> is returned.
6535        <p/>
6536      </description>
6537      <origin>new</origin>
6538      <capabilities>
6539      </capabilities>
6540      <parameters>
6541        <param id="class_loader">
6542          <ptrtype>
6543            <jobject/>
6544            <nullok>the bootstrap loader is assumed</nullok>
6545          </ptrtype>
6546          <description>
6547            A class loader.
6548            If the <code>class_loader</code> is not <code>NULL</code>
6549            or a subclass of <code>java.lang.ClassLoader</code>
6550            this function returns
6551            <errorlink id="JVMTI_ERROR_ILLEGAL_ARGUMENT"></errorlink>.
6552          </description>
6553        </param>
6554        <param id="package_name">
6555          <inbuf><char/></inbuf>
6556          <description>
6557            The name of the package, encoded as a
6558            <internallink id="mUTF">modified UTF-8</internallink> string.
6559            The package name is in internal form (JVMS 4.2.1);
6560            identifiers are separated by forward slashes rather than periods.
6561          </description>
6562        </param>
6563        <param id="module_ptr">
6564          <outptr><jobject/></outptr>
6565          <description>
6566            On return, points to a <code>java.lang.Module</code> object
6567            or points to <code>NULL</code>.
6568          </description>
6569        </param>
6570      </parameters>
6571      <errors>
6572        <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6573          If class loader is not <code>NULL</code> and is not a class loader object.
6574        </error>
6575      </errors>
6576    </function>
6577
6578    <function id="AddModuleReads" num="94" since="9">
6579      <synopsis>Add Module Reads</synopsis>
6580      <description>
6581         Update a module to read another module. This function is a no-op
6582         when <paramlink id="module"></paramlink> is an unnamed module.
6583         This function facilitates the instrumentation of code
6584         in named modules where that instrumentation requires
6585         expanding the set of modules that a module reads.
6586      </description>
6587      <origin>new</origin>
6588      <capabilities>
6589      </capabilities>
6590      <parameters>
6591        <param id="module">
6592          <ptrtype><jobject/></ptrtype>
6593          <description>
6594            The module to update.
6595          </description>
6596        </param>
6597        <param id="to_module">
6598          <ptrtype><jobject/></ptrtype>
6599          <description>
6600            The additional module to read.
6601          </description>
6602        </param>
6603      </parameters>
6604      <errors>
6605        <error id="JVMTI_ERROR_INVALID_MODULE">
6606          If <paramlink id="module"></paramlink> is not a module object.
6607        </error>
6608        <error id="JVMTI_ERROR_INVALID_MODULE">
6609          If <paramlink id="to_module"></paramlink> is not a module object.
6610        </error>
6611        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6612          if the module cannot be modified.
6613          See <functionlink id="IsModifiableModule"/>.
6614        </error>
6615      </errors>
6616    </function>
6617
6618    <function id="AddModuleExports" num="95" since="9">
6619      <synopsis>Add Module Exports</synopsis>
6620      <description>
6621         Update a module to export a package to another module.
6622         This function is a no-op when <paramlink id="module"></paramlink>
6623         is an unnamed module or an open module.
6624         This function facilitates the instrumentation of code
6625         in named modules where that instrumentation requires
6626         expanding the set of packages that a module exports.
6627      </description>
6628      <origin>new</origin>
6629      <capabilities>
6630      </capabilities>
6631      <parameters>
6632        <param id="module">
6633          <ptrtype><jobject/></ptrtype>
6634          <description>
6635            The module to update.
6636          </description>
6637        </param>
6638        <param id="pkg_name">
6639          <inbuf><char/></inbuf>
6640          <description>
6641            The exported package name.
6642          </description>
6643        </param>
6644        <param id="to_module">
6645          <ptrtype><jobject/></ptrtype>
6646          <description>
6647            The module the package is exported to.
6648            If the <code>to_module</code> is not a subclass of
6649            <code>java.lang.Module</code> this function returns
6650            <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
6651          </description>
6652        </param>
6653      </parameters>
6654      <errors>
6655        <error id="JVMTI_ERROR_INVALID_MODULE">
6656          If <paramlink id="module"></paramlink> is not a module object.
6657        </error>
6658        <error id="JVMTI_ERROR_INVALID_MODULE">
6659          If <paramlink id="to_module"></paramlink> is not a module object.
6660        </error>
6661        <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6662          If the package <paramlink id="pkg_name"></paramlink>
6663          does not belong to the module.
6664        </error>
6665        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6666          if the module cannot be modified.
6667          See <functionlink id="IsModifiableModule"/>.
6668        </error>
6669      </errors>
6670    </function>
6671
6672    <function id="AddModuleOpens" num="96" since="9">
6673      <synopsis>Add Module Opens</synopsis>
6674      <description>
6675         Update a module to open a package to another module.
6676         This function is a no-op when <paramlink id="module"></paramlink>
6677         is an unnamed module or an open module.
6678         This function facilitates the instrumentation of code
6679         in modules where that instrumentation requires
6680         expanding the set of packages that a module opens to
6681         other modules.
6682      </description>
6683      <origin>new</origin>
6684      <capabilities>
6685      </capabilities>
6686      <parameters>
6687        <param id="module">
6688          <ptrtype><jobject/></ptrtype>
6689          <description>
6690            The module to update.
6691          </description>
6692        </param>
6693        <param id="pkg_name">
6694          <inbuf><char/></inbuf>
6695          <description>
6696            The package name of the package to open.
6697          </description>
6698        </param>
6699        <param id="to_module">
6700          <ptrtype><jobject/></ptrtype>
6701          <description>
6702            The module with the package to open.
6703            If the <code>to_module</code> is not a subclass of
6704            <code>java.lang.Module</code> this function returns
6705            <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
6706          </description>
6707        </param>
6708      </parameters>
6709      <errors>
6710        <error id="JVMTI_ERROR_INVALID_MODULE">
6711          If <paramlink id="module"></paramlink> is not a module object.
6712        </error>
6713        <error id="JVMTI_ERROR_INVALID_MODULE">
6714          If <paramlink id="to_module"></paramlink> is not a module object.
6715        </error>
6716        <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6717          If the package <paramlink id="pkg_name"></paramlink>
6718          does not belong to the module.
6719        </error>
6720        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6721          if the module cannot be modified.
6722          See <functionlink id="IsModifiableModule"/>.
6723        </error>
6724      </errors>
6725    </function>
6726
6727    <function id="AddModuleUses" num="97" since="9">
6728      <synopsis>Add Module Uses</synopsis>
6729      <description>
6730         Updates a module to add a service to the set of services that
6731         a module uses. This function is a no-op when the module
6732         is an unnamed module.
6733         This function facilitates the instrumentation of code
6734         in named modules where that instrumentation requires
6735         expanding the set of services that a module is using.
6736      </description>
6737      <origin>new</origin>
6738      <capabilities>
6739      </capabilities>
6740      <parameters>
6741        <param id="module">
6742          <ptrtype><jobject/></ptrtype>
6743          <description>
6744            The module to update.
6745          </description>
6746        </param>
6747        <param id="service">
6748          <ptrtype><jclass/></ptrtype>
6749          <description>
6750            The service to use.
6751          </description>
6752        </param>
6753      </parameters>
6754      <errors>
6755        <error id="JVMTI_ERROR_INVALID_MODULE">
6756          If <paramlink id="module"></paramlink> is not a module object.
6757        </error>
6758        <error id="JVMTI_ERROR_INVALID_CLASS">
6759          If <paramlink id="service"></paramlink> is not a class object.
6760        </error>
6761        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6762          if the module cannot be modified.
6763          See <functionlink id="IsModifiableModule"/>.
6764        </error>
6765      </errors>
6766    </function>
6767
6768    <function id="AddModuleProvides" num="98" since="9">
6769      <synopsis>Add Module Provides</synopsis>
6770      <description>
6771         Updates a module to add a service to the set of services that
6772         a module provides. This function is a no-op when the module
6773         is an unnamed module.
6774         This function facilitates the instrumentation of code
6775         in named modules where that instrumentation requires
6776         changes to the services that are provided.
6777      </description>
6778      <origin>new</origin>
6779      <capabilities>
6780      </capabilities>
6781      <parameters>
6782        <param id="module">
6783          <ptrtype><jobject/></ptrtype>
6784          <description>
6785            The module to update.
6786          </description>
6787        </param>
6788        <param id="service">
6789          <ptrtype><jclass/></ptrtype>
6790          <description>
6791            The service to provide.
6792          </description>
6793        </param>
6794        <param id="impl_class">
6795          <ptrtype><jclass/></ptrtype>
6796          <description>
6797            The implementation class for the provided service.
6798          </description>
6799        </param>
6800      </parameters>
6801      <errors>
6802        <error id="JVMTI_ERROR_INVALID_MODULE">
6803          If <paramlink id="module"></paramlink> is not a module object.
6804        </error>
6805        <error id="JVMTI_ERROR_INVALID_CLASS">
6806          If <paramlink id="service"></paramlink> is not a class object.
6807        </error>
6808        <error id="JVMTI_ERROR_INVALID_CLASS">
6809          If <paramlink id="impl_class"></paramlink> is not a class object.
6810        </error>
6811        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6812          if the module cannot be modified.
6813          See <functionlink id="IsModifiableModule"/>.
6814        </error>
6815      </errors>
6816    </function>
6817
6818    <function id="IsModifiableModule" num="99" since="9">
6819      <synopsis>Is Modifiable Module</synopsis>
6820      <description>
6821        Determines whether a module is modifiable.
6822        If a module is modifiable then this module can be updated with
6823        <functionlink id="AddModuleReads"/>, <functionlink id="AddModuleExports"/>,
6824        <functionlink id="AddModuleOpens"/>, <functionlink id="AddModuleUses"/>,
6825        and <functionlink id="AddModuleProvides"/>. If a module is not modifiable
6826        then the module can not be updated with these functions. The result of
6827        this function is always <code>JNI_TRUE</code> when called to determine
6828        if an unnamed module is modifiable.
6829      </description>
6830      <origin>new</origin>
6831      <capabilities>
6832      </capabilities>
6833      <parameters>
6834        <param id="module">
6835          <ptrtype><jobject/></ptrtype>
6836          <description>
6837            The module to query.
6838          </description>
6839        </param>
6840        <param id="is_modifiable_module_ptr">
6841          <outptr><jboolean/></outptr>
6842          <description>
6843            On return, points to the boolean result of this function.
6844          </description>
6845        </param>
6846      </parameters>
6847      <errors>
6848        <error id="JVMTI_ERROR_INVALID_MODULE">
6849          If <paramlink id="module"></paramlink> is not a module object.
6850        </error>
6851      </errors>
6852    </function>
6853
6854  </category>
6855
6856  <category id="class" label="Class">
6857
6858    <intro>
6859    </intro>
6860
6861    <function id="GetLoadedClasses" jkernel="yes" num="78">
6862      <synopsis>Get Loaded Classes</synopsis>
6863      <description>
6864	Return an array of all classes loaded in the virtual machine.
6865	The number of classes in the array is returned via
6866	<code>class_count_ptr</code>, and the array itself via
6867	<code>classes_ptr</code>.
6868	<p/>
6869	Array classes of all types (including arrays of primitive types) are
6870	included in the returned list. Primitive classes (for example,
6871	<code>java.lang.Integer.TYPE</code>) are <i>not</i> included in this list.
6872      </description>
6873      <origin>jvmdi</origin>
6874      <capabilities>
6875      </capabilities>
6876      <parameters>
6877	<param id="class_count_ptr">
6878	  <outptr><jint/></outptr>
6879	  <description>
6880	    On return, points to the number of classes.
6881	  </description>
6882	</param>
6883	<param id="classes_ptr">
6884	  <allocbuf outcount="class_count_ptr"><jclass/></allocbuf>
6885	    <description>
6886	      On return, points to an array of references, one
6887	      for each class.
6888	    </description>
6889	</param>
6890      </parameters>
6891      <errors>
6892      </errors>
6893    </function>
6894
6895    <function id="GetClassLoaderClasses" jkernel="yes" num="79">
6896      <synopsis>Get Classloader Classes</synopsis>
6897      <description>
6898	Returns an array of those classes for which this class loader has
6899	been recorded as an initiating loader. Each
6900	class in the returned array was created by this class loader,
6901	either by defining it directly or by delegation to another class loader.
6902	See <vmspec chapter="5.3"/>.
6903	<p/>
6904	The number of classes in the array is returned via
6905	<code>class_count_ptr</code>, and the array itself via
6906	<code>classes_ptr</code>.
6907      </description>
6908      <origin>jvmdi</origin>
6909      <capabilities>
6910      </capabilities>
6911      <parameters>
6912	<param id="initiating_loader">
6913          <ptrtype>
6914            <jobject/>
6915	    <nullok>the classes initiated by the bootstrap loader will be returned</nullok>
6916          </ptrtype>
6917	    <description>
6918	      An initiating class loader.
6919	    </description>
6920	</param>
6921	<param id="class_count_ptr">
6922	  <outptr><jint/></outptr>
6923	  <description>
6924	    On return, points to the number of classes.
6925	  </description>
6926	</param>
6927	<param id="classes_ptr">
6928	  <allocbuf outcount="class_count_ptr"><jclass/></allocbuf>
6929	    <description>
6930	      On return, points to an array of references, one
6931	      for each class.
6932	    </description>
6933	</param>
6934      </parameters>
6935      <errors>
6936      </errors>
6937    </function>
6938
6939    <function id="GetClassSignature" phase="start" num="48">
6940      <synopsis>Get Class Signature</synopsis>
6941      <description>
6942        For the class indicated by <code>klass</code>, return the
6943        <externallink id="jni/types.html#type-signatures">JNI
6944            type signature</externallink>
6945        and the generic signature of the class.
6946        For example, <code>java.util.List</code> is <code>"Ljava/util/List;"</code>
6947        and <code>int[]</code> is <code>"[I"</code>
6948	The returned name for primitive classes
6949	is the type signature character of the corresponding primitive type.
6950        For example, <code>java.lang.Integer.TYPE</code> is <code>"I"</code>.
6951      </description>
6952      <origin>jvmdiClone</origin>
6953      <capabilities>
6954      </capabilities>
6955      <parameters>
6956	<param id="klass">
6957	  <jclass/>
6958	    <description>
6959	      The class to query.
6960	    </description>
6961	</param>
6962	<param id="signature_ptr">
6963	  <allocbuf>
6964            <char/>
6965            <nullok>the signature is not returned</nullok>
6966          </allocbuf>
6967	  <description>
6968	    On return, points to the JNI type signature of the class, encoded as a
6969	    <internallink id="mUTF">modified UTF-8</internallink> string.
6970	  </description>
6971	</param>
6972	<param id="generic_ptr">
6973	  <allocbuf>
6974            <char/>
6975            <nullok>the generic signature is not returned</nullok>
6976          </allocbuf>
6977	  <description>
6978	    On return, points to the generic signature of the class, encoded as a
6979	    <internallink id="mUTF">modified UTF-8</internallink> string.
6980            If there is no generic signature attribute for the class, then,
6981            on return, points to <code>NULL</code>.
6982	  </description>
6983	</param>
6984      </parameters>
6985      <errors>
6986      </errors>
6987    </function>
6988
6989    <function id="GetClassStatus" phase="start" num="49">
6990      <synopsis>Get Class Status</synopsis>
6991      <description>
6992	Get the status of the class. Zero or more of the following bits can be
6993	set.
6994	<constants id="jvmtiClassStatus" label="Class Status Flags" kind="bits">
6995	  <constant id="JVMTI_CLASS_STATUS_VERIFIED" num="1">
6996	    Class bytecodes have been verified
6997	  </constant>
6998	  <constant id="JVMTI_CLASS_STATUS_PREPARED" num="2">
6999	    Class preparation is complete
7000	  </constant>
7001	  <constant id="JVMTI_CLASS_STATUS_INITIALIZED" num="4">
7002	    Class initialization is complete. Static initializer has been run.
7003	  </constant>
7004	  <constant id="JVMTI_CLASS_STATUS_ERROR" num="8">
7005	    Error during initialization makes class unusable
7006	  </constant>
7007	  <constant id="JVMTI_CLASS_STATUS_ARRAY" num="16">
7008	    Class is an array.  If set, all other bits are zero.
7009	  </constant>
7010	  <constant id="JVMTI_CLASS_STATUS_PRIMITIVE" num="32">
7011	    Class is a primitive class (for example, <code>java.lang.Integer.TYPE</code>).
7012	    If set, all other bits are zero.
7013	  </constant>
7014	</constants>
7015      </description>
7016      <origin>jvmdi</origin>
7017      <capabilities>
7018      </capabilities>
7019      <parameters>
7020	<param id="klass">
7021	  <jclass/>
7022	    <description>
7023	      The class to query.
7024	    </description>
7025	</param>
7026	<param id="status_ptr">
7027	  <outptr><jint/></outptr>
7028	  <description>
7029	    On return, points to the current state of this class as one or
7030	    more of the <internallink id="jvmtiClassStatus">class status flags</internallink>.
7031	  </description>
7032	</param>
7033      </parameters>
7034      <errors>
7035      </errors>
7036    </function>
7037
7038    <function id="GetSourceFileName" phase="start" num="50">
7039      <synopsis>Get Source File Name</synopsis>
7040      <description>
7041	For the class indicated by <code>klass</code>, return the source file
7042	name via <code>source_name_ptr</code>. The returned string
7043	is a file name only and never contains a directory name.
7044	<p/>
7045	For primitive classes (for example, <code>java.lang.Integer.TYPE</code>)
7046	and for arrays this function returns
7047	<errorlink id="JVMTI_ERROR_ABSENT_INFORMATION"></errorlink>.
7048      </description>
7049      <origin>jvmdi</origin>
7050      <capabilities>
7051 	<required id="can_get_source_file_name"></required>
7052      </capabilities>
7053      <parameters>
7054	<param id="klass">
7055	  <jclass/>
7056	    <description>
7057	      The class to query.
7058	    </description>
7059	</param>
7060	<param id="source_name_ptr">
7061	  <allocbuf><char/></allocbuf>
7062	  <description>
7063	    On return, points to the class's source file name, encoded as a
7064	    <internallink id="mUTF">modified UTF-8</internallink> string.
7065	  </description>
7066	</param>
7067      </parameters>
7068      <errors>
7069	<error id="JVMTI_ERROR_ABSENT_INFORMATION">
7070	  Class information does not include a source file name. This includes
7071	  cases where the class is an array class or primitive class.
7072	</error>
7073      </errors>
7074    </function>
7075
7076    <function id="GetClassModifiers" phase="start" num="51">
7077      <synopsis>Get Class Modifiers</synopsis>
7078      <description>
7079	For the class indicated by <code>klass</code>, return the access
7080	flags
7081	via <code>modifiers_ptr</code>.
7082	Access flags are defined in <vmspec chapter="4"/>.
7083	<p/>
7084	If the class is an array class, then its public, private, and protected
7085	modifiers are the same as those of its component type. For arrays of
7086	primitives, this component type is represented by one of the primitive
7087	classes (for example, <code>java.lang.Integer.TYPE</code>).
7088	<p/>
7089	If the class is a primitive class, its public modifier is always true,
7090	and its protected and private modifiers are always false.
7091	<p/>
7092	If the class is an array class or a primitive class then its final
7093	modifier is always true and its interface modifier is always false.
7094	The values of its other modifiers are not determined by this specification.
7095
7096      </description>
7097      <origin>jvmdi</origin>
7098      <capabilities>
7099      </capabilities>
7100      <parameters>
7101	<param id="klass">
7102	  <jclass/>
7103	    <description>
7104	      The class to query.
7105	    </description>
7106	</param>
7107	<param id="modifiers_ptr">
7108	  <outptr><jint/></outptr>
7109	  <description>
7110	    On return, points to the current access flags of this class.
7111
7112	  </description>
7113	</param>
7114      </parameters>
7115      <errors>
7116      </errors>
7117    </function>
7118
7119    <function id="GetClassMethods" phase="start" num="52">
7120      <synopsis>Get Class Methods</synopsis>
7121      <description>
7122	For the class indicated by <code>klass</code>, return a count of
7123	methods via <code>method_count_ptr</code> and a list of
7124	method IDs via <code>methods_ptr</code>. The method list contains
7125	constructors and static initializers as well as true methods.
7126	Only directly declared methods are returned (not inherited methods).
7127	An empty method list is returned for array classes and primitive classes
7128	(for example, <code>java.lang.Integer.TYPE</code>).
7129      </description>
7130      <origin>jvmdi</origin>
7131      <capabilities>
7132        <capability id="can_maintain_original_method_order"/>
7133      </capabilities>
7134      <parameters>
7135	<param id="klass">
7136	  <jclass/>
7137	    <description>
7138	      The class to query.
7139	    </description>
7140	</param>
7141	<param id="method_count_ptr">
7142	  <outptr><jint/></outptr>
7143	  <description>
7144	    On return, points to the number of methods declared in this class.
7145	  </description>
7146	</param>
7147	<param id="methods_ptr">
7148	  <allocbuf outcount="method_count_ptr"><jmethodID class="klass"/></allocbuf>
7149	    <description>
7150	      On return, points to the method ID array.
7151	    </description>
7152	</param>
7153      </parameters>
7154      <errors>
7155	<error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7156	  <paramlink id="klass"></paramlink> is not prepared.
7157	</error>
7158      </errors>
7159    </function>
7160
7161    <function id="GetClassFields" phase="start" num="53">
7162      <synopsis>Get Class Fields</synopsis>
7163      <description>
7164	For the class indicated by <code>klass</code>, return a count of fields
7165	via <code>field_count_ptr</code> and a list of field IDs via
7166	<code>fields_ptr</code>.
7167	Only directly declared fields are returned (not inherited fields).
7168	Fields are returned in the order they occur in the class file.
7169	An empty field list is returned for array classes and primitive classes
7170	(for example, <code>java.lang.Integer.TYPE</code>).
7171	Use JNI to determine the length of an array.
7172      </description>
7173      <origin>jvmdi</origin>
7174      <capabilities>
7175      </capabilities>
7176      <parameters>
7177	<param id="klass">
7178	  <jclass/>
7179	    <description>
7180	      The class to query.
7181	    </description>
7182	</param>
7183	<param id="field_count_ptr">
7184	  <outptr><jint/></outptr>
7185	  <description>
7186	    On return, points to the number of fields declared in this class.
7187	  </description>
7188	</param>
7189	<param id="fields_ptr">
7190	  <allocbuf outcount="field_count_ptr"><jfieldID/></allocbuf>
7191	    <description>
7192	      On return, points to the field ID array.
7193	    </description>
7194	</param>
7195      </parameters>
7196      <errors>
7197	<error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7198	  <paramlink id="klass"></paramlink> is not prepared.
7199	</error>
7200      </errors>
7201    </function>
7202
7203    <function id="GetImplementedInterfaces" phase="start" num="54">
7204      <synopsis>Get Implemented Interfaces</synopsis>
7205      <description>
7206	Return the direct super-interfaces of this class. For a class, this
7207	function returns the interfaces declared in its <code>implements</code>
7208	clause. For an interface, this function returns the interfaces declared in
7209	its <code>extends</code> clause.
7210	An empty interface list is returned for array classes and primitive classes
7211	(for example, <code>java.lang.Integer.TYPE</code>).
7212      </description>
7213      <origin>jvmdi</origin>
7214      <capabilities>
7215      </capabilities>
7216      <parameters>
7217	<param id="klass">
7218	  <jclass/>
7219	    <description>
7220	      The class to query.
7221	    </description>
7222	</param>
7223	<param id="interface_count_ptr">
7224	  <outptr><jint/></outptr>
7225	  <description>
7226	    On return, points to the number of interfaces.
7227	  </description>
7228	</param>
7229	<param id="interfaces_ptr">
7230	  <allocbuf outcount="interface_count_ptr"><jclass/></allocbuf>
7231	    <description>
7232	      On return, points to the interface array.
7233	    </description>
7234	</param>
7235      </parameters>
7236      <errors>
7237	<error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7238	  <paramlink id="klass"></paramlink> is not prepared.
7239	</error>
7240      </errors>
7241    </function>
7242
7243    <function id="GetClassVersionNumbers" phase="start" num="145" since="1.1">
7244      <synopsis>Get Class Version Numbers</synopsis>
7245      <description>
7246        For the class indicated by <code>klass</code>,
7247        return the minor and major version numbers,
7248        as defined in
7249        <vmspec chapter="4"/>.
7250      </description>
7251      <origin>new</origin>
7252      <capabilities>
7253      </capabilities>
7254      <parameters>
7255	<param id="klass">
7256	  <jclass/>
7257	    <description>
7258	      The class to query.
7259	    </description>
7260	</param>
7261	<param id="minor_version_ptr">
7262	  <outptr><jint/></outptr>
7263	  <description>
7264	    On return, points to the value of the
7265            <code>minor_version</code> item of the
7266            Class File Format.
7267            Note: to be consistent with the Class File Format,
7268            the minor version number is the first parameter.
7269	  </description>
7270	</param>
7271	<param id="major_version_ptr">
7272	  <outptr><jint/></outptr>
7273	  <description>
7274	    On return, points to the value of the
7275            <code>major_version</code> item of the
7276            Class File Format.
7277	  </description>
7278	</param>
7279      </parameters>
7280      <errors>
7281	<error id="JVMTI_ERROR_ABSENT_INFORMATION">
7282	  The class is a primitive or array class.
7283	</error>
7284      </errors>
7285    </function>
7286
7287    <function id="GetConstantPool" phase="start" num="146" since="1.1">
7288      <synopsis>Get Constant Pool</synopsis>
7289      <description>
7290	For the class indicated by <code>klass</code>,
7291        return the raw bytes of the constant pool in the format of the
7292        <code>constant_pool</code> item of
7293        <vmspec chapter="4"/>.
7294        The format of the constant pool may differ between versions
7295        of the Class File Format, so, the
7296        <functionlink id="GetClassVersionNumbers">minor and major
7297        class version numbers</functionlink> should be checked for
7298        compatibility.
7299        <p/>
7300        The returned constant pool might not have the same layout or
7301        contents as the constant pool in the defining class file.
7302        The constant pool returned by GetConstantPool() may have
7303        more or fewer entries than the defining constant pool.
7304        Entries may be in a different order.
7305        The constant pool returned by GetConstantPool() will match the
7306        constant pool used by
7307        <functionlink id="GetBytecodes">GetBytecodes()</functionlink>.
7308        That is, the bytecodes returned by GetBytecodes() will have
7309        constant pool indices which refer to constant pool entries returned
7310        by GetConstantPool().
7311        Note that since <functionlink id="RetransformClasses"/>
7312        and <functionlink id="RedefineClasses"/> can change
7313        the constant pool, the constant pool returned by this function
7314        can change accordingly.  Thus, the correspondence between
7315        GetConstantPool() and GetBytecodes() does not hold if there
7316        is an intervening class retransformation or redefinition.
7317        The value of a constant pool entry used by a given bytecode will
7318        match that of the defining class file (even if the indices don't match).
7319        Constant pool entries which are not used directly or indirectly by
7320        bytecodes (for example,  UTF-8 strings associated with annotations) are
7321        not  required to exist in the returned constant pool.
7322      </description>
7323      <origin>new</origin>
7324      <capabilities>
7325	<required id="can_get_constant_pool"></required>
7326      </capabilities>
7327      <parameters>
7328	<param id="klass">
7329	  <jclass/>
7330	    <description>
7331	      The class to query.
7332	    </description>
7333	</param>
7334	<param id="constant_pool_count_ptr">
7335	  <outptr><jint/></outptr>
7336	  <description>
7337	    On return, points to the number of entries
7338            in the constant pool table plus one.
7339            This corresponds to the <code>constant_pool_count</code>
7340            item of the Class File Format.
7341	  </description>
7342	</param>
7343	<param id="constant_pool_byte_count_ptr">
7344	  <outptr><jint/></outptr>
7345	  <description>
7346	    On return, points to the number of bytes
7347            in the returned raw constant pool.
7348	  </description>
7349	</param>
7350	<param id="constant_pool_bytes_ptr">
7351	  <allocbuf outcount="constant_pool_byte_count_ptr"><uchar/></allocbuf>
7352	    <description>
7353	      On return, points to the raw constant pool, that is the bytes
7354              defined by the <code>constant_pool</code> item of the
7355              Class File Format
7356	    </description>
7357	</param>
7358      </parameters>
7359      <errors>
7360	<error id="JVMTI_ERROR_ABSENT_INFORMATION">
7361	  The class is a primitive or array class.
7362	</error>
7363      </errors>
7364    </function>
7365
7366    <function id="IsInterface" phase="start" num="55">
7367      <synopsis>Is Interface</synopsis>
7368      <description>
7369	Determines whether a class object reference represents an interface.
7370	The <code>jboolean</code> result is
7371	<code>JNI_TRUE</code> if the "class" is actually an interface,
7372	<code>JNI_FALSE</code> otherwise.
7373      </description>
7374      <origin>jvmdi</origin>
7375      <capabilities>
7376      </capabilities>
7377      <parameters>
7378	<param id="klass">
7379	  <jclass/>
7380	    <description>
7381	      The class to query.
7382	    </description>
7383	</param>
7384	<param id="is_interface_ptr">
7385	  <outptr><jboolean/></outptr>
7386	  <description>
7387	    On return, points to the boolean result of this function.
7388
7389	  </description>
7390	</param>
7391      </parameters>
7392      <errors>
7393      </errors>
7394    </function>
7395
7396    <function id="IsArrayClass" phase="start" num="56">
7397      <synopsis>Is Array Class</synopsis>
7398      <description>
7399	Determines whether a class object reference represents an array.
7400	The <code>jboolean</code> result is
7401	<code>JNI_TRUE</code> if the class is an array,
7402	<code>JNI_FALSE</code> otherwise.
7403      </description>
7404      <origin>jvmdi</origin>
7405      <capabilities>
7406      </capabilities>
7407      <parameters>
7408	<param id="klass">
7409	  <jclass/>
7410	    <description>
7411	      The class to query.
7412	    </description>
7413	</param>
7414	<param id="is_array_class_ptr">
7415	  <outptr><jboolean/></outptr>
7416	  <description>
7417	    On return, points to the boolean result of this function.
7418
7419	  </description>
7420	</param>
7421      </parameters>
7422      <errors>
7423      </errors>
7424    </function>
7425
7426    <function id="IsModifiableClass" jkernel="yes" phase="start" num="45" since="1.1">
7427      <synopsis>Is Modifiable Class</synopsis>
7428      <description>
7429	Determines whether a class is modifiable.
7430        If a class is modifiable (<paramlink id="is_modifiable_class_ptr"/>
7431        returns <code>JNI_TRUE</code>) the class can be
7432        redefined with <functionlink id="RedefineClasses"/> (assuming
7433        the agent possesses the
7434        <fieldlink id="can_redefine_classes" struct="jvmtiCapabilities"/>
7435        capability) or
7436        retransformed with <functionlink id="RetransformClasses"/> (assuming
7437        the agent possesses the
7438        <fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/>
7439        capability).
7440        If a class is not modifiable (<paramlink id="is_modifiable_class_ptr"/>
7441        returns <code>JNI_FALSE</code>) the class can be neither
7442        redefined nor retransformed.
7443        <p/>
7444        Primitive classes (for example, <code>java.lang.Integer.TYPE</code>),
7445        array classes, and some implementation defined classes are never modifiable.
7446        <p/>
7447      </description>
7448      <origin>new</origin>
7449      <capabilities>
7450        <capability id="can_redefine_any_class">
7451          If possessed then all classes (except primitive, array, and some implementation defined
7452          classes) are modifiable (redefine or retransform).
7453        </capability>
7454        <capability id="can_retransform_any_class">
7455          If possessed then all classes (except primitive, array, and some implementation defined
7456          classes) are modifiable with <functionlink id="RetransformClasses"/>.
7457        </capability>
7458        <capability id="can_redefine_classes">
7459          No effect on the result of the function.
7460          But must additionally be possessed to modify the class with
7461          <functionlink id="RedefineClasses"/>.
7462        </capability>
7463        <capability id="can_retransform_classes">
7464          No effect on the result of the function.
7465          But must additionally be possessed to modify the class with
7466          <functionlink id="RetransformClasses"/>.
7467        </capability>
7468      </capabilities>
7469      <parameters>
7470	<param id="klass">
7471	  <jclass/>
7472	    <description>
7473	      The class to query.
7474	    </description>
7475	</param>
7476	<param id="is_modifiable_class_ptr">
7477	  <outptr><jboolean/></outptr>
7478	  <description>
7479	    On return, points to the boolean result of this function.
7480	  </description>
7481	</param>
7482      </parameters>
7483      <errors>
7484      </errors>
7485    </function>
7486
7487    <function id="GetClassLoader" phase="start" num="57">
7488      <synopsis>Get Class Loader</synopsis>
7489      <description>
7490	For the class indicated by <code>klass</code>, return via
7491	<code>classloader_ptr</code> a reference to the class loader for the
7492	class.
7493      </description>
7494      <origin>jvmdi</origin>
7495      <capabilities>
7496      </capabilities>
7497      <parameters>
7498	<param id="klass">
7499	  <jclass/>
7500	    <description>
7501	      The class to query.
7502	    </description>
7503	</param>
7504	<param id="classloader_ptr">
7505	  <outptr><jobject/></outptr>
7506	    <description>
7507	      On return, points to the class loader that loaded
7508	      this class.
7509              If the class was not created by a class loader
7510              or if the class loader is the bootstrap class loader,
7511              points to <code>NULL</code>.
7512 	    </description>
7513	</param>
7514      </parameters>
7515      <errors>
7516      </errors>
7517
7518    </function>
7519
7520    <function id="GetSourceDebugExtension" phase="start" num="90">
7521      <synopsis>Get Source Debug Extension</synopsis>
7522      <description>
7523	For the class indicated by <code>klass</code>, return the debug
7524        extension via <code>source_debug_extension_ptr</code>.
7525        The returned string
7526	contains exactly the debug extension information present in the
7527	class file of <code>klass</code>.
7528      </description>
7529      <origin>jvmdi</origin>
7530      <capabilities>
7531	<required id="can_get_source_debug_extension"></required>
7532      </capabilities>
7533      <parameters>
7534	<param id="klass">
7535	  <jclass/>
7536	    <description>
7537	      The class to query.
7538	    </description>
7539	</param>
7540	<param id="source_debug_extension_ptr">
7541	  <allocbuf><char/></allocbuf>
7542	  <description>
7543	    On return, points to the class's debug extension, encoded as a
7544	    <internallink id="mUTF">modified UTF-8</internallink> string.
7545	  </description>
7546	</param>
7547      </parameters>
7548      <errors>
7549	<error id="JVMTI_ERROR_ABSENT_INFORMATION">
7550	  Class information does not include a debug extension.
7551	</error>
7552      </errors>
7553    </function>
7554
7555    <function id="RetransformClasses" jkernel="yes" num="152" since="1.1">
7556      <synopsis>Retransform Classes</synopsis>
7557      <description>
7558        This function facilitates the
7559        <internallink id="bci">bytecode instrumentation</internallink>
7560        of already loaded classes.
7561        To replace the class definition without reference to the existing
7562        bytecodes, as one might do when recompiling from source for
7563        fix-and-continue debugging, <functionlink id="RedefineClasses"/>
7564        function should be used instead.
7565        <p/>
7566        When classes are initially loaded or when they are
7567        <functionlink id="RedefineClasses">redefined</functionlink>,
7568        the initial class file bytes can be transformed with the
7569        <eventlink id="ClassFileLoadHook"/> event.
7570        This function reruns the transformation process
7571        (whether or not a transformation has previously occurred).
7572        This retransformation follows these steps:
7573        <ul>
7574          <li>starting from the initial class file bytes
7575          </li>
7576          <li>for each <fieldlink id="can_retransform_classes"
7577                     struct="jvmtiCapabilities">retransformation
7578                                                incapable</fieldlink>
7579            agent which received a
7580            <code>ClassFileLoadHook</code> event during the previous
7581            load or redefine, the bytes it returned
7582            (via the <code>new_class_data</code> parameter)
7583            are reused as the output of the transformation;
7584            note that this is equivalent to reapplying
7585            the previous transformation, unaltered. except that
7586            the <code>ClassFileLoadHook</code> event
7587            is <b>not</b> sent to these agents
7588          </li>
7589          <li>for each <fieldlink id="can_retransform_classes"
7590                     struct="jvmtiCapabilities">retransformation
7591                                                capable</fieldlink>
7592            agent, the <code>ClassFileLoadHook</code> event is sent,
7593            allowing a new transformation to be applied
7594          </li>
7595          <li>the transformed class file bytes are installed as the new
7596            definition of the class
7597          </li>
7598        </ul>
7599        See the <eventlink id="ClassFileLoadHook"/> event for more details.
7600        <p/>
7601        The initial class file bytes represent the bytes passed to
7602        <code>ClassLoader.defineClass</code>
7603        or <code>RedefineClasses</code> (before any transformations
7604        were applied), however they may not exactly match them.
7605        The constant pool may differ in ways described in
7606        <functionlink id="GetConstantPool"/>.
7607        Constant pool indices in the bytecodes of methods will correspond.
7608        Some attributes may not be present.
7609        Where order is not meaningful, for example the order of methods,
7610        order may not be preserved.
7611        <p/>
7612        Retransformation can cause new versions of methods to be installed.
7613        Old method versions may become
7614        <internallink id="obsoleteMethods">obsolete</internallink>
7615        The new method version will be used on new invokes.
7616        If a method has active stack frames, those active frames continue to
7617        run the bytecodes of the original method version.
7618        <p/>
7619        This function does not cause any initialization except that which
7620        would occur under the customary JVM semantics.
7621        In other words, retransforming a class does not cause its initializers to be
7622        run. The values of static fields will remain as they were
7623        prior to the call.
7624        <p/>
7625        Threads need not be suspended.
7626        <p/>
7627        All breakpoints in the class are cleared.
7628        <p/>
7629        All attributes are updated.
7630        <p/>
7631        Instances of the retransformed class are not affected -- fields retain their
7632        previous values.
7633        <functionlink id="GetTag">Tags</functionlink> on the instances are
7634        also unaffected.
7635        <p/>
7636        In response to this call, no events other than the
7637        <eventlink id="ClassFileLoadHook"/> event
7638        will be sent.
7639        <p/>
7640        The retransformation may change method bodies, the constant pool and attributes
7641        (unless explicitly prohibited).
7642        The retransformation must not add, remove or rename fields or methods, change the
7643        signatures of methods, change modifiers, or change inheritance.
7644        The retransformation must not change the <code>NestHost</code> or
7645        <code>NestMembers</code> attributes.
7646        These restrictions may be lifted in future versions.
7647        See the error return description below for information on error codes
7648        returned if an unsupported retransformation is attempted.
7649        The class file bytes are not verified or installed until they have passed
7650        through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the
7651        returned error code reflects the result of the transformations.
7652        If any error code is returned other than <code>JVMTI_ERROR_NONE</code>,
7653        none of the classes to be retransformed will have a new definition installed.
7654        When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>)
7655        all of the classes to be retransformed will have their new definitions installed.
7656      </description>
7657      <origin>new</origin>
7658      <capabilities>
7659        <required id="can_retransform_classes"></required>
7660        <capability id="can_retransform_any_class"></capability>
7661      </capabilities>
7662      <parameters>
7663        <param id="class_count">
7664          <jint min="0"/>
7665          <description>
7666            The number of classes to be retransformed.
7667          </description>
7668        </param>
7669        <param id="classes">
7670          <inbuf incount="class_count"><jclass/></inbuf>
7671          <description>
7672            The array of classes to be retransformed.
7673          </description>
7674        </param>
7675      </parameters>
7676      <errors>
7677        <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS">
7678          One of the <paramlink id="classes"/> cannot be modified.
7679          See <functionlink id="IsModifiableClass"/>.
7680        </error>
7681        <error id="JVMTI_ERROR_INVALID_CLASS">
7682          One of the <paramlink id="classes"/> is not a valid class.
7683        </error>
7684        <error id="JVMTI_ERROR_UNSUPPORTED_VERSION">
7685          A retransformed class file has a version number not supported by this VM.
7686        </error>
7687        <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT">
7688          A retransformed class file is malformed (The VM would return a <code>ClassFormatError</code>).
7689        </error>
7690        <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION">
7691          The retransformed class file definitions would lead to a circular definition
7692          (the VM would return a <code>ClassCircularityError</code>).
7693        </error>
7694        <error id="JVMTI_ERROR_FAILS_VERIFICATION">
7695          The retransformed class file bytes fail verification.
7696        </error>
7697        <error id="JVMTI_ERROR_NAMES_DONT_MATCH">
7698          The class name defined in a retransformed class file is
7699          different from the name in the old class object.
7700        </error>
7701        <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED">
7702          A retransformed class file would require adding a method.
7703        </error>
7704        <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED">
7705          A retransformed class file changes a field.
7706        </error>
7707        <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED">
7708          A direct superclass is different for a retransformed class file,
7709          or the set of directly implemented
7710          interfaces is different.
7711        </error>
7712        <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED">
7713          A retransformed class file does not declare a method
7714          declared in the old class version.
7715        </error>
7716        <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED">
7717          A retransformed class file has unsupported differences in class attributes.
7718        </error>
7719        <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED">
7720          A retransformed class file has different class modifiers.
7721        </error>
7722        <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED">
7723          A method in the retransformed class file has different modifiers
7724          than its counterpart in the old class version.
7725        </error>
7726      </errors>
7727    </function>
7728
7729    <function id="RedefineClasses" jkernel="yes" num="87">
7730      <synopsis>Redefine Classes</synopsis>
7731      <typedef id="jvmtiClassDefinition" label="Class redefinition description">
7732	<field id="klass">
7733	  <jclass/>
7734	    <description>
7735	      Class object for this class
7736	    </description>
7737	</field>
7738	<field id="class_byte_count">
7739	  <jint/>
7740	  <description>
7741	    Number of bytes defining class (below)
7742	  </description>
7743	</field>
7744	<field id="class_bytes">
7745	  <inbuf incount="class_byte_count"><uchar/></inbuf>
7746	  <description>
7747            Bytes defining class (in <vmspec chapter="4"/>)
7748	  </description>
7749	</field>
7750      </typedef>
7751      <description>
7752	All classes given are redefined according to the definitions
7753	supplied.
7754	This function is used to replace the definition of a class
7755	with a new definition, as might be needed in fix-and-continue
7756	debugging.
7757	Where the existing class file bytes are to be transformed, for
7758	example in
7759	<internallink id="bci">bytecode instrumentation</internallink>,
7760	<functionlink id="RetransformClasses"/> should be used.
7761	<p/>
7762	Redefinition can cause new versions of methods to be installed.
7763	Old method versions may become
7764	<internallink id="obsoleteMethods">obsolete</internallink>
7765	The new method version will be used on new invokes.
7766	If a method has active stack frames, those active frames continue to
7767        run the bytecodes of the original method version.
7768	If resetting of stack frames is desired, use
7769	<functionlink id="PopFrame"></functionlink>
7770	to pop frames with obsolete method versions.
7771	<p/>
7772	This function does not cause any initialization except that which
7773	would occur under the customary JVM semantics.
7774	In other words, redefining a class does not cause its initializers to be
7775	run. The values of static fields will remain as they were
7776	prior to the call.
7777	<p/>
7778	Threads need not be suspended.
7779	<p/>
7780	All breakpoints in the class are cleared.
7781	<p/>
7782	All attributes are updated.
7783	<p/>
7784        Instances of the redefined class are not affected -- fields retain their
7785        previous values.
7786	<functionlink id="GetTag">Tags</functionlink> on the instances are
7787        also unaffected.
7788	<p/>
7789	In response to this call, the <jvmti/> event
7790        <eventlink id="ClassFileLoadHook">Class File Load Hook</eventlink>
7791        will be sent (if enabled), but no other <jvmti/> events will be sent.
7792        <p/>
7793        The redefinition may change method bodies, the constant pool and attributes
7794        (unless explicitly prohibited).
7795        The redefinition must not add, remove or rename fields or methods, change the
7796        signatures of methods, change modifiers, or change inheritance.
7797        The retransformation must not change the <code>NestHost</code> or
7798        <code>NestMembers</code> attributes.
7799        These restrictions may be lifted in future versions.
7800	See the error return description below for information on error codes
7801	returned if an unsupported redefinition is attempted.
7802        The class file bytes are not verified or installed until they have passed
7803        through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the
7804        returned error code reflects the result of the transformations applied
7805        to the bytes passed into <paramlink id="class_definitions"/>.
7806        If any error code is returned other than <code>JVMTI_ERROR_NONE</code>,
7807        none of the classes to be redefined will have a new definition installed.
7808        When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>)
7809        all of the classes to be redefined will have their new definitions installed.
7810      </description>
7811      <origin>jvmdi</origin>
7812      <capabilities>
7813	<required id="can_redefine_classes"></required>
7814        <capability id="can_redefine_any_class"></capability>
7815      </capabilities>
7816      <parameters>
7817	<param id="class_count">
7818	  <jint min="0"/>
7819	  <description>
7820	    The number of classes specified in <code>class_definitions</code>
7821	  </description>
7822	</param>
7823	<param id="class_definitions">
7824	  <inbuf incount="class_count"><struct>jvmtiClassDefinition</struct></inbuf>
7825	  <description>
7826	    The array of new class definitions
7827	  </description>
7828	</param>
7829      </parameters>
7830      <errors>
7831	<error id="JVMTI_ERROR_NULL_POINTER">
7832	  One of <code>class_bytes</code> is <code>NULL</code>.
7833	</error>
7834	<error id="JVMTI_ERROR_UNMODIFIABLE_CLASS">
7835	  An element of <code>class_definitions</code> cannot be modified.
7836          See <functionlink id="IsModifiableClass"/>.
7837	</error>
7838	<error id="JVMTI_ERROR_INVALID_CLASS">
7839	  An element of <code>class_definitions</code> is not a valid class.
7840	</error>
7841	<error id="JVMTI_ERROR_UNSUPPORTED_VERSION">
7842	  A new class file has a version number not supported by this VM.
7843	</error>
7844	<error id="JVMTI_ERROR_INVALID_CLASS_FORMAT">
7845	  A new class file is malformed (The VM would return a <code>ClassFormatError</code>).
7846	</error>
7847	<error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION">
7848	  The new class file definitions would lead to a circular definition
7849	  (the VM would return a <code>ClassCircularityError</code>).
7850	</error>
7851	<error id="JVMTI_ERROR_FAILS_VERIFICATION">
7852	  The class bytes fail verification.
7853	</error>
7854	<error id="JVMTI_ERROR_NAMES_DONT_MATCH">
7855	  The class name defined in a new class file is
7856	  different from the name in the old class object.
7857	</error>
7858	<error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED">
7859	  A new class file would require adding a method.
7860	</error>
7861	<error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED">
7862	  A new class version changes a field.
7863	</error>
7864	<error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED">
7865	  A direct superclass is different for a new class
7866	  version, or the set of directly implemented
7867	  interfaces is different.
7868	</error>
7869	<error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED">
7870	  A new class version does not declare a method
7871	  declared in the old class version.
7872	</error>
7873        <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED">
7874          A new class version has unsupported differences in class attributes.
7875        </error>
7876	<error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED">
7877	  A new class version has different modifiers.
7878	</error>
7879	<error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED">
7880	  A method in the new class version has different modifiers
7881	  than its counterpart in the old class version.
7882	</error>
7883        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
7884          A module cannot be modified.
7885          See <functionlink id="IsModifiableModule"/>.
7886        </error>
7887      </errors>
7888    </function>
7889
7890  </category>
7891
7892  <category id="object" label="Object">
7893
7894    <function id="GetObjectSize" jkernel="yes" phase="start" num="154">
7895      <synopsis>Get Object Size</synopsis>
7896      <description>
7897	For the object indicated by <code>object</code>,
7898	return via <code>size_ptr</code> the size of the object.
7899        This size is an implementation-specific approximation of
7900        the amount of storage consumed by this object.
7901        It may include some or all of the object's overhead, and thus
7902        is useful for comparison within an implementation but not
7903        between implementations.
7904        The estimate may change during a single invocation of the JVM.
7905      </description>
7906      <origin>new</origin>
7907      <capabilities>
7908      </capabilities>
7909      <parameters>
7910	<param id="object">
7911	  <jobject/>
7912	    <description>
7913	      The object to query.
7914	    </description>
7915	</param>
7916	<param id="size_ptr">
7917	  <outptr><jlong/></outptr>
7918	  <description>
7919	    On return, points to the object's size in bytes.
7920	  </description>
7921	</param>
7922      </parameters>
7923      <errors>
7924      </errors>
7925    </function>
7926
7927    <function id="GetObjectHashCode" phase="start" num="58">
7928      <synopsis>Get Object Hash Code</synopsis>
7929      <description>
7930	For the object indicated by <code>object</code>,
7931	return via <code>hash_code_ptr</code> a hash code.
7932        This hash code could be used to maintain a hash table of object references,
7933        however, on some implementations this can cause significant performance
7934        impacts--in most cases
7935        <internallink id="Heap">tags</internallink>
7936        will be a more efficient means of associating information with objects.
7937	This function guarantees
7938	the same hash code value for a particular object throughout its life
7939      </description>
7940      <origin>jvmdi</origin>
7941      <capabilities>
7942      </capabilities>
7943      <parameters>
7944	<param id="object">
7945	  <jobject/>
7946	    <description>
7947	      The object to query.
7948	    </description>
7949	</param>
7950	<param id="hash_code_ptr">
7951	  <outptr><jint/></outptr>
7952	  <description>
7953	    On return, points to the object's hash code.
7954	  </description>
7955	</param>
7956      </parameters>
7957      <errors>
7958      </errors>
7959    </function>
7960
7961    <function id="GetObjectMonitorUsage" num="59">
7962      <synopsis>Get Object Monitor Usage</synopsis>
7963      <typedef id="jvmtiMonitorUsage" label="Object monitor usage information">
7964	<field id="owner">
7965	  <jthread/>
7966	    <description>
7967	      The thread owning this monitor, or <code>NULL</code> if unused
7968	    </description>
7969	</field>
7970	<field id="entry_count">
7971	  <jint/>
7972	  <description>
7973	    The number of times the owning thread has entered the monitor
7974	  </description>
7975	</field>
7976	<field id="waiter_count">
7977	  <jint/>
7978	  <description>
7979	    The number of threads waiting to own this monitor
7980	  </description>
7981	</field>
7982	<field id="waiters">
7983	  <allocfieldbuf><jthread/></allocfieldbuf>
7984	    <description>
7985	      The <code>waiter_count</code> waiting threads
7986	    </description>
7987	</field>
7988	<field id="notify_waiter_count">
7989	  <jint/>
7990	  <description>
7991	    The number of threads waiting to be notified by this monitor
7992	  </description>
7993	</field>
7994	<field id="notify_waiters">
7995	  <allocfieldbuf><jthread/></allocfieldbuf>
7996	    <description>
7997	      The <code>notify_waiter_count</code> threads waiting to be notified
7998	    </description>
7999	</field>
8000      </typedef>
8001      <description>
8002	Get information about the object's monitor.
8003	The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure
8004	are filled in with information about usage of the monitor.
8005	  <todo>
8006	    Decide and then clarify suspend requirements.
8007	  </todo>
8008      </description>
8009      <origin>jvmdi</origin>
8010      <capabilities>
8011	<required id="can_get_monitor_info"></required>
8012      </capabilities>
8013      <parameters>
8014	<param id="object">
8015	  <jobject/>
8016	    <description>
8017	      The object to query.
8018	    </description>
8019	</param>
8020	<param id="info_ptr">
8021	  <outptr><struct>jvmtiMonitorUsage</struct></outptr>
8022	  <description>
8023	    On return, filled with monitor information for the
8024	    specified object.
8025	  </description>
8026	</param>
8027      </parameters>
8028      <errors>
8029      </errors>
8030    </function>
8031
8032    <elide>
8033    <function id="GetObjectMonitors" num="116">
8034      <synopsis>Get Object Monitors</synopsis>
8035      <description>
8036        Return the list of object monitors.
8037        <p/>
8038        Note: details about each monitor can be examined with
8039        <functionlink id="GetObjectMonitorUsage"></functionlink>.
8040      </description>
8041      <origin>new</origin>
8042      <capabilities>
8043        <required id="can_get_monitor_info"></required>
8044      </capabilities>
8045      <parameters>
8046        <param id="monitorCnt">
8047	  <outptr><jint/></outptr>
8048	  <description>
8049	    On return, pointer to the number
8050	    of monitors returned in <code>monitors_ptr</code>.
8051	  </description>
8052	</param>
8053        <param id="monitors_ptr">
8054	  <allocbuf outcount="monitorCnt"><jobject/></allocbuf>
8055	    <description>
8056	      On return, pointer to the monitor list.
8057	    </description>
8058	</param>
8059      </parameters>
8060      <errors>
8061      </errors>
8062    </function>
8063    </elide>
8064
8065  </category>
8066
8067  <category id="fieldCategory" label="Field">
8068
8069    <intro>
8070    </intro>
8071
8072    <function id="GetFieldName" phase="start" num="60">
8073      <synopsis>Get Field Name (and Signature)</synopsis>
8074      <description>
8075	For the field indicated by <paramlink id="klass"/> and <paramlink id="field"/>,
8076	return the field name via <paramlink id="name_ptr"/> and field signature via
8077	<paramlink id="signature_ptr"/>.
8078	<p/>
8079        Field signatures are defined in the
8080        <externallink id="jni/index.html">JNI Specification</externallink>
8081        and are referred to as <code>field descriptors</code> in
8082        <vmspec chapter="4.3.2"/>.
8083      </description>
8084      <origin>jvmdiClone</origin>
8085      <capabilities>
8086      </capabilities>
8087      <parameters>
8088	<param id="klass">
8089	  <jclass field="field"/>
8090	    <description>
8091	      The class of the field to query.
8092	    </description>
8093	</param>
8094	<param id="field">
8095	  <jfieldID class="klass"/>
8096	    <description>
8097	      The field to query.
8098	    </description>
8099	</param>
8100	<param id="name_ptr">
8101	  <allocbuf>
8102	    <char/>
8103	    <nullok>the name is not returned</nullok>
8104	  </allocbuf>
8105	  <description>
8106	    On return, points to the field name, encoded as a
8107	    <internallink id="mUTF">modified UTF-8</internallink> string.
8108	  </description>
8109	</param>
8110	<param id="signature_ptr">
8111	  <allocbuf>
8112	    <char/>
8113	    <nullok>the signature is not returned</nullok>
8114	  </allocbuf>
8115	  <description>
8116	    On return, points to the field signature, encoded as a
8117	    <internallink id="mUTF">modified UTF-8</internallink> string.
8118	  </description>
8119	</param>
8120	<param id="generic_ptr">
8121	  <allocbuf>
8122            <char/>
8123            <nullok>the generic signature is not returned</nullok>
8124          </allocbuf>
8125	  <description>
8126	    On return, points to the generic signature of the field, encoded as a
8127	    <internallink id="mUTF">modified UTF-8</internallink> string.
8128            If there is no generic signature attribute for the field, then,
8129            on return, points to <code>NULL</code>.
8130	  </description>
8131	</param>
8132      </parameters>
8133      <errors>
8134      </errors>
8135    </function>
8136
8137    <function id="GetFieldDeclaringClass" phase="start" num="61">
8138      <synopsis>Get Field Declaring Class</synopsis>
8139      <description>
8140	For the field indicated by <code>klass</code> and <code>field</code>
8141	return the class that defined it via <code>declaring_class_ptr</code>.
8142	The declaring class will either be <code>klass</code>, a superclass, or
8143	an implemented interface.
8144      </description>
8145      <origin>jvmdi</origin>
8146      <capabilities>
8147      </capabilities>
8148      <parameters>
8149	<param id="klass">
8150	  <jclass field="field"/>
8151	    <description>
8152	      The class to query.
8153	    </description>
8154	</param>
8155	<param id="field">
8156	  <jfieldID class="klass"/>
8157	    <description>
8158	      The field to query.
8159	    </description>
8160	</param>
8161	<param id="declaring_class_ptr">
8162	  <outptr><jclass/></outptr>
8163	    <description>
8164	      On return, points to the declaring class
8165	    </description>
8166	</param>
8167      </parameters>
8168      <errors>
8169      </errors>
8170    </function>
8171
8172    <function id="GetFieldModifiers" phase="start" num="62">
8173      <synopsis>Get Field Modifiers</synopsis>
8174      <description>
8175	For the field indicated by <code>klass</code> and <code>field</code>
8176	return the access flags via <code>modifiers_ptr</code>.
8177	Access flags are defined in <vmspec chapter="4"/>.
8178      </description>
8179      <origin>jvmdi</origin>
8180      <capabilities>
8181      </capabilities>
8182      <parameters>
8183	<param id="klass">
8184	  <jclass field="field"/>
8185	    <description>
8186	      The class to query.
8187	    </description>
8188	</param>
8189	<param id="field">
8190	  <jfieldID class="klass"/>
8191	    <description>
8192	      The field to query.
8193	    </description>
8194	</param>
8195	<param id="modifiers_ptr">
8196	  <outptr><jint/></outptr>
8197	  <description>
8198	    On return, points to the access flags.
8199	  </description>
8200	</param>
8201      </parameters>
8202      <errors>
8203      </errors>
8204    </function>
8205
8206    <function id="IsFieldSynthetic" phase="start" num="63">
8207      <synopsis>Is Field Synthetic</synopsis>
8208      <description>
8209	For the field indicated by <code>klass</code> and <code>field</code>, return a
8210	value indicating whether the field is synthetic via <code>is_synthetic_ptr</code>.
8211	Synthetic fields are generated by the compiler but not present in the
8212	original source code.
8213      </description>
8214      <origin>jvmdi</origin>
8215      <capabilities>
8216        <required id="can_get_synthetic_attribute"></required>
8217      </capabilities>
8218      <parameters>
8219	<param id="klass">
8220	  <jclass field="field"/>
8221	    <description>
8222	      The class of the field to query.
8223	    </description>
8224	</param>
8225	<param id="field">
8226	  <jfieldID class="klass"/>
8227	    <description>
8228	      The field to query.
8229	    </description>
8230	</param>
8231	<param id="is_synthetic_ptr">
8232	  <outptr><jboolean/></outptr>
8233	  <description>
8234	    On return, points to the boolean result of this function.
8235	  </description>
8236	</param>
8237      </parameters>
8238      <errors>
8239      </errors>
8240    </function>
8241
8242  </category>
8243
8244  <category id="method" label="Method">
8245
8246    <intro>
8247      These functions provide information about a method (represented as a
8248      <typelink id="jmethodID"/>) and set how methods are processed.
8249    </intro>
8250
8251    <intro id="obsoleteMethods" label="Obsolete Methods">
8252      The functions <functionlink id="RetransformClasses"/> and
8253      <functionlink id="RedefineClasses"/> can cause new versions
8254      of methods to be installed.
8255      An original version of a method is considered equivalent
8256      to the new version if:
8257      <ul>
8258        <li>their bytecodes are the same except for indices into the
8259          constant pool and </li>
8260        <li>the referenced constants are equal.</li>
8261      </ul>
8262      An original method version which is not equivalent to the
8263      new method version is called obsolete and is assigned a new method ID;
8264      the original method ID now refers to the new method version.
8265      A method ID can be tested for obsolescence with
8266      <functionlink id="IsMethodObsolete"/>.
8267    </intro>
8268
8269    <function id="GetMethodName" phase="start" num="64">
8270      <synopsis>Get Method Name (and Signature)</synopsis>
8271      <description>
8272	For the method indicated by <code>method</code>,
8273	return the method name via <code>name_ptr</code> and method signature via
8274	<code>signature_ptr</code>.
8275        <p/>
8276        Method signatures are defined in the
8277        <externallink id="jni/index.html">JNI Specification</externallink>
8278        and are referred to as <code>method descriptors</code> in
8279        <vmspec chapter="4.3.3"/>.
8280	Note this is different
8281	than method signatures as defined in the <i>Java Language Specification</i>.
8282      </description>
8283      <origin>jvmdiClone</origin>
8284      <capabilities>
8285      </capabilities>
8286      <parameters>
8287	<param id="method">
8288	  <jmethodID/>
8289	    <description>
8290	      The method to query.
8291	    </description>
8292	</param>
8293	<param id="name_ptr">
8294	  <allocbuf>
8295	    <char/>
8296	    <nullok>the name is not returned</nullok>
8297	  </allocbuf>
8298	  <description>
8299	    On return, points to the method name, encoded as a
8300	    <internallink id="mUTF">modified UTF-8</internallink> string.
8301	  </description>
8302	</param>
8303	<param id="signature_ptr">
8304	  <allocbuf>
8305	    <char/>
8306	    <nullok>the signature is not returned</nullok>
8307	  </allocbuf>
8308	  <description>
8309	    On return, points to the method signature, encoded as a
8310	    <internallink id="mUTF">modified UTF-8</internallink> string.
8311	  </description>
8312	</param>
8313	<param id="generic_ptr">
8314	  <allocbuf>
8315            <char/>
8316            <nullok>the generic signature is not returned</nullok>
8317          </allocbuf>
8318	  <description>
8319	    On return, points to the generic signature of the method, encoded as a
8320	    <internallink id="mUTF">modified UTF-8</internallink> string.
8321            If there is no generic signature attribute for the method, then,
8322            on return, points to <code>NULL</code>.
8323	  </description>
8324	</param>
8325      </parameters>
8326      <errors>
8327      </errors>
8328    </function>
8329
8330    <function id="GetMethodDeclaringClass" phase="start" num="65">
8331      <synopsis>Get Method Declaring Class</synopsis>
8332      <description>
8333	For the method indicated by <code>method</code>,
8334	return the class that defined it via <code>declaring_class_ptr</code>.
8335      </description>
8336      <origin>jvmdi</origin>
8337      <capabilities>
8338      </capabilities>
8339      <parameters>
8340	<param id="klass">
8341	  <jclass method="method"/>
8342	    <description>
8343	      The class to query.
8344	    </description>
8345	</param>
8346	<param id="method">
8347	  <jmethodID class="klass"/>
8348	    <description>
8349	      The method to query.
8350	    </description>
8351	</param>
8352	<param id="declaring_class_ptr">
8353	  <outptr><jclass/></outptr>
8354	    <description>
8355	      On return, points to the declaring class
8356	    </description>
8357	</param>
8358      </parameters>
8359      <errors>
8360      </errors>
8361    </function>
8362
8363    <function id="GetMethodModifiers" phase="start" num="66">
8364      <synopsis>Get Method Modifiers</synopsis>
8365      <description>
8366	For the method indicated by <code>method</code>,
8367	return the access flags via <code>modifiers_ptr</code>.
8368	Access flags are defined in <vmspec chapter="4"/>.
8369      </description>
8370      <origin>jvmdi</origin>
8371      <capabilities>
8372      </capabilities>
8373      <parameters>
8374	<param id="klass">
8375	  <jclass method="method"/>
8376	    <description>
8377	      The class to query.
8378	    </description>
8379	</param>
8380	<param id="method">
8381	  <jmethodID class="klass"/>
8382	    <description>
8383	      The method to query.
8384	    </description>
8385	</param>
8386	<param id="modifiers_ptr">
8387	  <outptr><jint/></outptr>
8388	  <description>
8389	    On return, points to the access flags.
8390	  </description>
8391	</param>
8392      </parameters>
8393      <errors>
8394      </errors>
8395    </function>
8396
8397    <function id="GetMaxLocals" phase="start" num="68">
8398      <synopsis>Get Max Locals</synopsis>
8399      <description>
8400	  For the method indicated by <code>method</code>,
8401	  return the number of local variable slots used by the method,
8402	  including the local variables used to pass parameters to the
8403	  method on its invocation.
8404	  <p/>
8405	  See <code>max_locals</code> in <vmspec chapter="4.7.3"/>.
8406      </description>
8407      <origin>jvmdi</origin>
8408      <capabilities>
8409      </capabilities>
8410      <parameters>
8411	<param id="klass">
8412	  <jclass method="method"/>
8413	    <description>
8414	      The class to query.
8415	    </description>
8416	</param>
8417	<param id="method">
8418	  <jmethodID class="klass" native="error"/>
8419	    <description>
8420	      The method to query.
8421	    </description>
8422	</param>
8423	<param id="max_ptr">
8424	  <outptr><jint/></outptr>
8425	  <description>
8426	    On return, points to the maximum number of local slots
8427	  </description>
8428	</param>
8429      </parameters>
8430      <errors>
8431      </errors>
8432    </function>
8433
8434    <function id="GetArgumentsSize" phase="start" num="69">
8435      <synopsis>Get Arguments Size</synopsis>
8436      <description>
8437	For the method indicated by <code>method</code>,
8438	return via <code>max_ptr</code> the number of local variable slots used
8439	by the method's arguments.
8440	Note that two-word arguments use two slots.
8441      </description>
8442      <origin>jvmdi</origin>
8443      <capabilities>
8444      </capabilities>
8445      <parameters>
8446	<param id="klass">
8447	  <jclass method="method"/>
8448	    <description>
8449	      The class to query.
8450	    </description>
8451	</param>
8452	<param id="method">
8453	  <jmethodID class="klass" native="error"/>
8454	    <description>
8455	      The method to query.
8456	    </description>
8457	</param>
8458	<param id="size_ptr">
8459	  <outptr><jint/></outptr>
8460	  <description>
8461	    On return, points to the number of argument slots
8462	  </description>
8463	</param>
8464      </parameters>
8465      <errors>
8466      </errors>
8467    </function>
8468
8469    <function id="GetLineNumberTable" phase="start" num="70">
8470      <synopsis>Get Line Number Table</synopsis>
8471      <typedef id="jvmtiLineNumberEntry" label="Line number table entry">
8472	<field id="start_location">
8473	  <jlocation/>
8474	  <description>
8475	    the <datalink id="jlocation"></datalink> where the line begins
8476	  </description>
8477	</field>
8478	<field id="line_number">
8479	  <jint/>
8480	  <description>
8481	    the line number
8482	  </description>
8483	</field>
8484      </typedef>
8485      <description>
8486	For the method indicated by <code>method</code>,
8487	return a table of source line number entries. The size of the table is
8488	returned via <code>entry_count_ptr</code> and the table itself is
8489	returned via <code>table_ptr</code>.
8490      </description>
8491      <origin>jvmdi</origin>
8492      <capabilities>
8493	<required id="can_get_line_numbers"></required>
8494      </capabilities>
8495      <parameters>
8496	<param id="klass">
8497	  <jclass method="method"/>
8498	    <description>
8499	      The class to query.
8500	    </description>
8501	</param>
8502	<param id="method">
8503	  <jmethodID class="klass" native="error"/>
8504	    <description>
8505	      The method to query.
8506	    </description>
8507	</param>
8508	<param id="entry_count_ptr">
8509	  <outptr><jint/></outptr>
8510	  <description>
8511	    On return, points to the number of entries in the table
8512	  </description>
8513	</param>
8514	<param id="table_ptr">
8515	  <allocbuf outcount="entry_count_ptr"><struct>jvmtiLineNumberEntry</struct></allocbuf>
8516	  <description>
8517	    On return, points to the line number table pointer.
8518	  </description>
8519	</param>
8520      </parameters>
8521      <errors>
8522	<error id="JVMTI_ERROR_ABSENT_INFORMATION">
8523	  Class information does not include line numbers.
8524	</error>
8525      </errors>
8526    </function>
8527
8528    <function id="GetMethodLocation" phase="start" num="71">
8529      <synopsis>Get Method Location</synopsis>
8530      <description>
8531	For the method indicated by <code>method</code>,
8532	return the beginning and ending addresses through
8533	<code>start_location_ptr</code> and <code>end_location_ptr</code>. In a
8534	conventional bytecode indexing scheme,
8535	<code>start_location_ptr</code> will always point to zero
8536	and <code>end_location_ptr</code>
8537	will always point to the bytecode count minus one.
8538      </description>
8539      <origin>jvmdi</origin>
8540      <capabilities>
8541      </capabilities>
8542      <parameters>
8543	<param id="klass">
8544	  <jclass method="method"/>
8545	    <description>
8546	      The class to query.
8547	    </description>
8548	</param>
8549	<param id="method">
8550	  <jmethodID class="klass" native="error"/>
8551	    <description>
8552	      The method to query.
8553	    </description>
8554	</param>
8555	<param id="start_location_ptr">
8556	  <outptr><jlocation/></outptr>
8557	  <description>
8558	    On return, points to the first location, or
8559	    <code>-1</code> if location information is not available.
8560	    If the information is available and
8561	    <functionlink id="GetJLocationFormat"></functionlink>
8562	    returns <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>
8563	    then this will always be zero.
8564	  </description>
8565	</param>
8566	<param id="end_location_ptr">
8567	  <outptr><jlocation/></outptr>
8568	  <description>
8569	    On return, points to the last location,
8570	    or <code>-1</code> if location information is not available.
8571	  </description>
8572	</param>
8573      </parameters>
8574      <errors>
8575	<error id="JVMTI_ERROR_ABSENT_INFORMATION">
8576	  Class information does not include method sizes.
8577	</error>
8578      </errors>
8579    </function>
8580
8581    <function id="GetLocalVariableTable" num="72">
8582      <synopsis>Get Local Variable Table</synopsis>
8583      <typedef id="jvmtiLocalVariableEntry" label="Local variable table entry">
8584	<field id="start_location">
8585	  <jlocation/>
8586	  <description>
8587	    The code array index where the local variable is first valid
8588            (that is, where it must have a value).
8589	  </description>
8590	</field>
8591	<field id="length">
8592	  <jint/>
8593	  <description>
8594            The length of the valid section for this local variable.
8595	    The last code array index where the local variable is valid
8596            is <code>start_location + length</code>.
8597	  </description>
8598	</field>
8599	<field id="name">
8600	  <allocfieldbuf><char/></allocfieldbuf>
8601	  <description>
8602	    The local variable name, encoded as a
8603	    <internallink id="mUTF">modified UTF-8</internallink> string.
8604	  </description>
8605	</field>
8606	<field id="signature">
8607	  <allocfieldbuf><char/></allocfieldbuf>
8608	  <description>
8609	    The local variable's type signature, encoded as a
8610	    <internallink id="mUTF">modified UTF-8</internallink> string.
8611	    The signature format is the same as that defined in
8612	    <vmspec chapter="4.3.2"/>.
8613	  </description>
8614	</field>
8615	<field id="generic_signature">
8616	  <allocfieldbuf><char/></allocfieldbuf>
8617	  <description>
8618	    The local variable's generic signature, encoded as a
8619	    <internallink id="mUTF">modified UTF-8</internallink> string.
8620            The value of this field will be <code>NULL</code> for any local
8621            variable which does not have a generic type.
8622	  </description>
8623	</field>
8624	<field id="slot">
8625	  <jint/>
8626	  <description>
8627	    The local variable's slot.  See <internallink id="local">Local Variables</internallink>.
8628	  </description>
8629	</field>
8630      </typedef>
8631      <description>
8632	Return local variable information.
8633      </description>
8634      <origin>jvmdiClone</origin>
8635      <capabilities>
8636	<required id="can_access_local_variables"></required>
8637      </capabilities>
8638      <parameters>
8639	<param id="method">
8640	  <jmethodID native="error"/>
8641	    <description>
8642	      The method to query.
8643	    </description>
8644	</param>
8645	<param id="entry_count_ptr">
8646	  <outptr><jint/></outptr>
8647	  <description>
8648	    On return, points to the number of entries in the table
8649	  </description>
8650	</param>
8651	<param id="table_ptr">
8652	  <allocbuf outcount="entry_count_ptr"><struct>jvmtiLocalVariableEntry</struct></allocbuf>
8653	  <description>
8654	    On return, points to an array of local variable table entries.
8655	  </description>
8656	</param>
8657      </parameters>
8658      <errors>
8659	<error id="JVMTI_ERROR_ABSENT_INFORMATION">
8660	  Class information does not include local variable
8661	  information.
8662	</error>
8663      </errors>
8664    </function>
8665
8666    <function id="GetBytecodes" phase="start" num="75">
8667      <synopsis>Get Bytecodes</synopsis>
8668      <description>
8669	For the method indicated by <code>method</code>,
8670	return the bytecodes that implement the method. The number of
8671	bytecodes is returned via <code>bytecode_count_ptr</code>. The bytecodes
8672	themselves are returned via <code>bytecodes_ptr</code>.
8673      </description>
8674      <origin>jvmdi</origin>
8675      <capabilities>
8676	<required id="can_get_bytecodes"></required>
8677      </capabilities>
8678      <parameters>
8679	<param id="klass">
8680	  <jclass method="method"/>
8681	    <description>
8682	      The class to query.
8683	    </description>
8684	</param>
8685	<param id="method">
8686	  <jmethodID class="klass" native="error"/>
8687	    <description>
8688	      The method to query.
8689	    </description>
8690	</param>
8691	<param id="bytecode_count_ptr">
8692	  <outptr><jint/></outptr>
8693	  <description>
8694	    On return, points to the length of the bytecode array
8695	  </description>
8696	</param>
8697	<param id="bytecodes_ptr">
8698	  <allocbuf outcount="bytecode_count_ptr"><uchar/></allocbuf>
8699	  <description>
8700	    On return, points to the pointer to the bytecode array
8701	  </description>
8702	</param>
8703      </parameters>
8704      <errors>
8705      </errors>
8706    </function>
8707
8708    <function id="IsMethodNative" phase="start" num="76">
8709      <synopsis>Is Method Native</synopsis>
8710      <description>
8711	For the method indicated by <code>method</code>, return a
8712	value indicating whether the method is native via <code>is_native_ptr</code>
8713      </description>
8714      <origin>jvmdi</origin>
8715      <capabilities>
8716      </capabilities>
8717      <parameters>
8718	<param id="klass">
8719	  <jclass method="method"/>
8720	    <description>
8721	      The class to query.
8722	    </description>
8723	</param>
8724	<param id="method">
8725	  <jmethodID class="klass"/>
8726	    <description>
8727	      The method to query.
8728	    </description>
8729	</param>
8730	<param id="is_native_ptr">
8731	  <outptr><jboolean/></outptr>
8732	  <description>
8733	    On return, points to the boolean result of this function.
8734	  </description>
8735	</param>
8736      </parameters>
8737      <errors>
8738      </errors>
8739    </function>
8740
8741    <function id="IsMethodSynthetic" phase="start" num="77">
8742      <synopsis>Is Method Synthetic</synopsis>
8743      <description>
8744	For the method indicated by <code>method</code>, return a
8745	value indicating whether the method is synthetic via <code>is_synthetic_ptr</code>.
8746	Synthetic methods are generated by the compiler but not present in the
8747	original source code.
8748      </description>
8749      <origin>jvmdi</origin>
8750      <capabilities>
8751        <required id="can_get_synthetic_attribute"></required>
8752      </capabilities>
8753      <parameters>
8754	<param id="klass">
8755	  <jclass method="method"/>
8756	    <description>
8757	      The class to query.
8758	    </description>
8759	</param>
8760	<param id="method">
8761	  <jmethodID class="klass"/>
8762	    <description>
8763	      The method to query.
8764	    </description>
8765	</param>
8766	<param id="is_synthetic_ptr">
8767	  <outptr><jboolean/></outptr>
8768	  <description>
8769	    On return, points to the boolean result of this function.
8770	  </description>
8771	</param>
8772      </parameters>
8773      <errors>
8774      </errors>
8775    </function>
8776
8777    <function id="IsMethodObsolete" phase="start" num="91">
8778      <synopsis>Is Method Obsolete</synopsis>
8779      <description>
8780        Determine if a method ID refers to an
8781        <internallink id="obsoleteMethods">obsolete</internallink>
8782        method version.
8783      </description>
8784      <origin>jvmdi</origin>
8785      <capabilities>
8786      </capabilities>
8787      <parameters>
8788	<param id="klass">
8789	  <jclass method="method"/>
8790	    <description>
8791	      The class to query.
8792	    </description>
8793	</param>
8794	<param id="method">
8795	  <jmethodID class="klass"/>
8796	    <description>
8797	      The method ID to query.
8798	    </description>
8799	</param>
8800	<param id="is_obsolete_ptr">
8801	  <outptr><jboolean/></outptr>
8802	  <description>
8803	    On return, points to the boolean result of this function.
8804	  </description>
8805	</param>
8806      </parameters>
8807      <errors>
8808      </errors>
8809    </function>
8810
8811    <function id="SetNativeMethodPrefix" jkernel="yes" phase="any" num="73" since="1.1">
8812      <synopsis>Set Native Method Prefix</synopsis>
8813      <description>
8814	This function modifies the failure handling of
8815        native method resolution by allowing retry
8816        with a prefix applied to the name.
8817        When used with the
8818        <eventlink id="ClassFileLoadHook">ClassFileLoadHook
8819        event</eventlink>, it enables native methods to be
8820        <internallink id="bci">instrumented</internallink>.
8821        <p/>
8822        Since native methods cannot be directly instrumented
8823        (they have no bytecodes), they must be wrapped with
8824        a non-native method which can be instrumented.
8825        For example, if we had:
8826        <example>
8827native boolean foo(int x);</example>
8828        <p/>
8829        We could transform the class file (with the
8830        ClassFileLoadHook event) so that this becomes:
8831        <example>
8832boolean foo(int x) {
8833  <i>... record entry to foo ...</i>
8834  return wrapped_foo(x);
8835}
8836
8837native boolean wrapped_foo(int x);</example>
8838        <p/>
8839        Where foo becomes a wrapper for the actual native method
8840        with the appended prefix "wrapped_".  Note that
8841        "wrapped_" would be a poor choice of prefix since it
8842        might conceivably form the name of an existing method
8843        thus something like "$$$MyAgentWrapped$$$_" would be
8844        better but would make these examples less readable.
8845        <p/>
8846        The wrapper will allow data to be collected on the native
8847        method call, but now the problem becomes linking up the
8848        wrapped method with the native implementation.
8849        That is, the method <code>wrapped_foo</code> needs to be
8850        resolved to the native implementation of <code>foo</code>,
8851        which might be:
8852        <example>
8853Java_somePackage_someClass_foo(JNIEnv* env, jint x)</example>
8854        <p/>
8855        This function allows the prefix to be specified and the
8856        proper resolution to occur.
8857        Specifically, when the standard resolution fails, the
8858        resolution is retried taking the prefix into consideration.
8859        There are two ways that resolution occurs, explicit
8860        resolution with the JNI function <code>RegisterNatives</code>
8861        and the normal automatic resolution.  For
8862        <code>RegisterNatives</code>, the VM will attempt this
8863        association:
8864        <example>
8865method(foo) -> nativeImplementation(foo)</example>
8866        <p/>
8867        When this fails, the resolution will be retried with
8868        the specified prefix prepended to the method name,
8869        yielding the correct resolution:
8870        <example>
8871method(wrapped_foo) -> nativeImplementation(foo)</example>
8872        <p/>
8873        For automatic resolution, the VM will attempt:
8874        <example>
8875method(wrapped_foo) -> nativeImplementation(wrapped_foo)</example>
8876        <p/>
8877        When this fails, the resolution will be retried with
8878        the specified prefix deleted from the implementation name,
8879        yielding the correct resolution:
8880        <example>
8881method(wrapped_foo) -> nativeImplementation(foo)</example>
8882        <p/>
8883        Note that since the prefix is only used when standard
8884        resolution fails, native methods can be wrapped selectively.
8885        <p/>
8886        Since each <jvmti/> environment is independent and
8887        can do its own transformation of the bytecodes, more
8888        than one layer of wrappers may be applied. Thus each
8889        environment needs its own prefix.  Since transformations
8890        are applied in order, the prefixes, if applied, will
8891        be applied in the same order.
8892        The order of transformation application is described in
8893        the <eventlink id="ClassFileLoadHook"/> event.
8894        Thus if three environments applied
8895        wrappers, <code>foo</code> might become
8896        <code>$env3_$env2_$env1_foo</code>.  But if, say,
8897        the second environment did not apply a wrapper to
8898        <code>foo</code> it would be just
8899        <code>$env3_$env1_foo</code>.  To be able to
8900        efficiently determine the sequence of prefixes,
8901        an intermediate prefix is only applied if its non-native
8902        wrapper exists.  Thus, in the last example, even though
8903        <code>$env1_foo</code> is not a native method, the
8904        <code>$env1_</code> prefix is applied since
8905        <code>$env1_foo</code> exists.
8906        <p/>
8907        Since the prefixes are used at resolution time
8908        and since resolution may be arbitrarily delayed, a
8909        native method prefix must remain set as long as there
8910        are corresponding prefixed native methods.
8911      </description>
8912      <origin>new</origin>
8913      <capabilities>
8914	<required id="can_set_native_method_prefix"></required>
8915      </capabilities>
8916      <parameters>
8917	<param id="prefix">
8918	  <inbuf>
8919	    <char/>
8920	    <nullok>
8921	      any existing prefix in this environment is cancelled
8922	    </nullok>
8923	  </inbuf>
8924	  <description>
8925	    The prefix to apply, encoded as a
8926	    <internallink id="mUTF">modified UTF-8</internallink> string.
8927	  </description>
8928	</param>
8929      </parameters>
8930      <errors>
8931      </errors>
8932    </function>
8933
8934    <function id="SetNativeMethodPrefixes" jkernel="yes" phase="any" num="74" since="1.1">
8935      <synopsis>Set Native Method Prefixes</synopsis>
8936      <description>
8937	 For a normal agent, <functionlink id="SetNativeMethodPrefix"/>
8938         will provide all needed native method prefixing.
8939         For a meta-agent that performs multiple independent class
8940         file transformations (for example as a proxy for another
8941         layer of agents) this function allows each transformation
8942         to have its own prefix.
8943         The prefixes are applied in the order supplied and are
8944         processed in the same manner as described for the
8945         application of prefixes from multiple <jvmti/> environments
8946         in <functionlink id="SetNativeMethodPrefix"/>.
8947         <p/>
8948         Any previous prefixes are replaced.  Thus, calling this
8949         function with a <paramlink id="prefix_count"/> of <code>0</code>
8950         disables prefixing in this environment.
8951         <p/>
8952         <functionlink id="SetNativeMethodPrefix"/> and this function
8953         are the two ways to set the prefixes.
8954         Calling <code>SetNativeMethodPrefix</code> with
8955         a prefix is the same as calling this function with
8956         <paramlink id="prefix_count"/> of <code>1</code>.
8957         Calling <code>SetNativeMethodPrefix</code> with
8958         <code>NULL</code> is the same as calling this function with
8959         <paramlink id="prefix_count"/> of <code>0</code>.
8960      </description>
8961      <origin>new</origin>
8962      <capabilities>
8963	<required id="can_set_native_method_prefix"></required>
8964      </capabilities>
8965      <parameters>
8966	<param id="prefix_count">
8967	  <jint min="0"/>
8968	    <description>
8969	      The number of prefixes to apply.
8970	    </description>
8971	</param>
8972	<param id="prefixes">
8973	  <agentbuf>
8974            <char/>
8975          </agentbuf>
8976	  <description>
8977	    The prefixes to apply for this environment, each encoded as a
8978	    <internallink id="mUTF">modified UTF-8</internallink> string.
8979	  </description>
8980	</param>
8981      </parameters>
8982      <errors>
8983      </errors>
8984    </function>
8985
8986  </category>
8987
8988  <category id="RawMonitors" label="Raw Monitor">
8989
8990    <function id="CreateRawMonitor" phase="onload" callbacksafe="safe" num="31">
8991      <synopsis>Create Raw Monitor</synopsis>
8992      <description>
8993	Create a raw monitor.
8994      </description>
8995      <origin>jvmdi</origin>
8996      <capabilities>
8997      </capabilities>
8998      <parameters>
8999	<param id="name">
9000	  <inbuf><char/></inbuf>
9001	  <description>
9002	    A name to identify the monitor, encoded as a
9003	    <internallink id="mUTF">modified UTF-8</internallink> string.
9004	  </description>
9005	</param>
9006	<param id="monitor_ptr">
9007	  <outptr><jrawMonitorID/></outptr>
9008	  <description>
9009	    On return, points to the created monitor.
9010	  </description>
9011	</param>
9012      </parameters>
9013      <errors>
9014      </errors>
9015    </function>
9016
9017    <function id="DestroyRawMonitor" phase="onload" callbacksafe="safe" num="32">
9018      <synopsis>Destroy Raw Monitor</synopsis>
9019      <description>
9020	Destroy the raw monitor.
9021        If the monitor being destroyed has been entered by this thread, it will be
9022        exited before it is destroyed.
9023        If the monitor being destroyed has been entered by another thread,
9024        an error will be returned and the monitor will not be destroyed.
9025      </description>
9026      <origin>jvmdi</origin>
9027      <capabilities>
9028      </capabilities>
9029      <parameters>
9030	<param id="monitor">
9031	  <jrawMonitorID/>
9032	  <description>
9033	    The monitor
9034	  </description>
9035	</param>
9036      </parameters>
9037      <errors>
9038	<error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9039	  Not monitor owner
9040	</error>
9041      </errors>
9042    </function>
9043
9044    <function id="RawMonitorEnter" phase="any" callbacksafe="safe" impl="innative notrace" num="33">
9045      <synopsis>Raw Monitor Enter</synopsis>
9046      <description>
9047	Gain exclusive ownership of a raw monitor.
9048        The same thread may enter a monitor more then once.
9049        The thread must
9050        <functionlink id="RawMonitorExit">exit</functionlink>
9051        the monitor the same number of times as it is entered.
9052        If a monitor is entered during <code>OnLoad</code> (before attached threads exist)
9053	and has not exited when attached threads come into existence, the enter
9054	is considered to have occurred on the main thread.
9055      </description>
9056      <origin>jvmdi</origin>
9057      <capabilities>
9058      </capabilities>
9059      <parameters>
9060	<param id="monitor">
9061	  <jrawMonitorID/>
9062	  <description>
9063	    The monitor
9064	  </description>
9065	</param>
9066      </parameters>
9067      <errors>
9068      </errors>
9069    </function>
9070
9071    <function id="RawMonitorExit" phase="any" callbacksafe="safe" impl="innative notrace" num="34">
9072      <synopsis>Raw Monitor Exit</synopsis>
9073      <description>
9074	Release exclusive ownership of a raw monitor.
9075      </description>
9076      <origin>jvmdi</origin>
9077      <capabilities>
9078      </capabilities>
9079      <parameters>
9080	<param id="monitor">
9081	  <jrawMonitorID/>
9082	  <description>
9083	    The monitor
9084	  </description>
9085	</param>
9086      </parameters>
9087      <errors>
9088	<error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9089	  Not monitor owner
9090	</error>
9091      </errors>
9092    </function>
9093
9094    <function id="RawMonitorWait" phase="any" callbacksafe="safe" impl="innative notrace" num="35">
9095      <synopsis>Raw Monitor Wait</synopsis>
9096      <description>
9097        Wait for notification of the raw monitor.
9098        <p/>
9099        Causes the current thread to wait until either another thread calls
9100        <functionlink id="RawMonitorNotify"/> or
9101        <functionlink id="RawMonitorNotifyAll"/>
9102        for the specified raw monitor, or the specified
9103        <paramlink id="millis">timeout</paramlink>
9104        has elapsed.
9105      </description>
9106      <origin>jvmdi</origin>
9107      <capabilities>
9108      </capabilities>
9109      <parameters>
9110	<param id="monitor">
9111	  <jrawMonitorID/>
9112	  <description>
9113	    The monitor
9114	  </description>
9115	</param>
9116	<param id="millis">
9117	  <jlong/>
9118	  <description>
9119	    The timeout, in milliseconds.  If the timeout is
9120	    zero, then real time is not taken into consideration
9121	    and the thread simply waits until notified.
9122	  </description>
9123	</param>
9124      </parameters>
9125      <errors>
9126	<error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9127	  Not monitor owner
9128	</error>
9129	<error id="JVMTI_ERROR_INTERRUPT">
9130	  Wait was interrupted, try again
9131	</error>
9132      </errors>
9133    </function>
9134
9135    <function id="RawMonitorNotify" phase="any" callbacksafe="safe" impl="notrace" num="36">
9136      <synopsis>Raw Monitor Notify</synopsis>
9137      <description>
9138	Notify a single thread 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    <function id="RawMonitorNotifyAll" phase="any" callbacksafe="safe" impl="notrace" num="37">
9159      <synopsis>Raw Monitor Notify All</synopsis>
9160      <description>
9161	Notify all threads waiting on the raw monitor.
9162      </description>
9163      <origin>jvmdi</origin>
9164      <capabilities>
9165      </capabilities>
9166      <parameters>
9167	<param id="monitor">
9168	  <jrawMonitorID/>
9169	  <description>
9170	    The monitor
9171	  </description>
9172	</param>
9173      </parameters>
9174      <errors>
9175	<error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9176	  Not monitor owner
9177	</error>
9178      </errors>
9179    </function>
9180
9181   <elide>
9182    <function id="GetRawMonitorUse" num="118">
9183      <synopsis>Get Raw Monitor Use</synopsis>
9184      <description>
9185        The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure
9186        are filled in with information about usage of the raw monitor.
9187      </description>
9188      <origin>new</origin>
9189      <capabilities>
9190        <required id="can_get_raw_monitor_usage"></required>
9191      </capabilities>
9192      <parameters>
9193        <param id="monitor">
9194	  <jrawMonitorID/>
9195	  <description>
9196	    the raw monitor to query.
9197	  </description>
9198	</param>
9199        <param id="info_ptr">
9200	  <outptr><struct>jvmtiMonitorUsage</struct></outptr>
9201	  <description>
9202	    On return, filled with monitor information for the
9203	    specified raw monitor.
9204	  </description>
9205	</param>
9206      </parameters>
9207      <errors>
9208      </errors>
9209    </function>
9210
9211    <function id="GetRawMonitors" num="119">
9212      <synopsis>Get Raw Monitors</synopsis>
9213      <description>
9214        Return the list of raw monitors.
9215        <p/>
9216        Note: details about each monitor can be examined with
9217        <functionlink id="GetRawMonitorUse"></functionlink>.
9218      </description>
9219      <origin>new</origin>
9220      <capabilities>
9221        <required id="can_get_raw_monitor_usage"></required>
9222      </capabilities>
9223      <parameters>
9224        <param id="monitorCnt">
9225	  <outptr><jint/></outptr>
9226	  <description>
9227	    On return, pointer to the number
9228	    of monitors returned in <code>monitors_ptr</code>.
9229	  </description>
9230	</param>
9231        <param id="monitors_ptr">
9232	  <allocbuf outcount="monitorCnt"><jrawMonitorID/></allocbuf>
9233	  <description>
9234	    On return, pointer to the monitor list.
9235	  </description>
9236	</param>
9237      </parameters>
9238      <errors>
9239      </errors>
9240    </function>
9241    </elide>
9242  </category>
9243
9244  <category id="jniIntercept" label="JNI Function Interception">
9245
9246    <intro>
9247      Provides the ability to intercept and resend
9248      Java Native Interface (JNI) function calls
9249      by manipulating the JNI function table.
9250      See <externallink id="jni/functions.html">JNI
9251	Functions</externallink> in the <i>Java Native Interface Specification</i>.
9252      <p/>
9253      The following example illustrates intercepting the
9254      <code>NewGlobalRef</code> JNI call in order to count reference
9255      creation.
9256      <example>
9257JNIEnv original_jni_Functions;
9258JNIEnv redirected_jni_Functions;
9259int my_global_ref_count = 0;
9260
9261jobject
9262MyNewGlobalRef(JNIEnv *jni_env, jobject lobj) {
9263   ++my_global_ref_count;
9264   return originalJNIFunctions-&gt;NewGlobalRef(env, lobj);
9265}
9266
9267void
9268myInit() {
9269   jvmtiError err;
9270
9271   err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;original_jni_Functions);
9272   if (err != JVMTI_ERROR_NONE) {
9273      die();
9274   }
9275   err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;redirected_jni_Functions);
9276   if (err != JVMTI_ERROR_NONE) {
9277      die();
9278   }
9279   redirectedJNIFunctions-&gt;NewGlobalRef = MyNewGlobalRef;
9280      err = (*jvmti_env)-&gt;SetJNIFunctionTable(jvmti_env, redirected_jni_Functions);
9281   if (err != JVMTI_ERROR_NONE) {
9282      die();
9283   }
9284}
9285      </example>
9286      Sometime after <code>myInit</code> is called the user's JNI
9287      code is executed which makes the call to create a new global
9288      reference.  Instead of going to the normal JNI implementation
9289      the call goes to <code>myNewGlobalRef</code>.  Note that a
9290      copy of the original function table is kept so that the normal
9291      JNI function can be called after the data is collected.
9292      Note also that any JNI functions which are not overwritten
9293      will behave normally.
9294      <todo>
9295	check that the example compiles and executes.
9296      </todo>
9297    </intro>
9298
9299    <function id="SetJNIFunctionTable" phase="start" num="120">
9300      <synopsis>Set JNI Function Table</synopsis>
9301      <description>
9302        Set the JNI function table
9303        in all current and future JNI environments.
9304        As a result, all future JNI calls are directed to the specified functions.
9305        Use <functionlink id="GetJNIFunctionTable"></functionlink> to get the
9306        function table to pass to this function.
9307        For this function to take effect the the updated table entries must be
9308        used by the JNI clients.
9309        Since the table is defined <code>const</code> some compilers may optimize
9310        away the access to the table, thus preventing this function from taking
9311        effect.
9312        The table is copied--changes to the local copy of the
9313        table have no effect.
9314        This function affects only the function table, all other aspects of the environment are
9315        unaffected.
9316        See the examples <internallink id="jniIntercept">above</internallink>.
9317      </description>
9318      <origin>new</origin>
9319      <capabilities>
9320      </capabilities>
9321      <parameters>
9322        <param id="function_table">
9323	  <inptr>
9324	    <struct>jniNativeInterface</struct>
9325	  </inptr>
9326	  <description>
9327	    Points to the new JNI function table.
9328	  </description>
9329	</param>
9330      </parameters>
9331      <errors>
9332      </errors>
9333    </function>
9334
9335    <function id="GetJNIFunctionTable" phase="start" num="121">
9336      <synopsis>Get JNI Function Table</synopsis>
9337      <description>
9338        Get the JNI function table.
9339        The JNI function table is copied into allocated memory.
9340        If <functionlink id="SetJNIFunctionTable"></functionlink>
9341        has been called, the modified (not the original) function
9342        table is returned.
9343        Only the function table is copied, no other aspects of the environment
9344        are copied.
9345        See the examples <internallink id="jniIntercept">above</internallink>.
9346      </description>
9347      <origin>new</origin>
9348      <capabilities>
9349      </capabilities>
9350      <parameters>
9351        <param id="function_table">
9352	  <allocbuf>
9353	    <struct>jniNativeInterface</struct>
9354	  </allocbuf>
9355          <description>
9356	    On return, <code>*function_table</code>
9357	    points a newly allocated copy of the JNI function table.
9358	  </description>
9359	</param>
9360      </parameters>
9361      <errors>
9362      </errors>
9363    </function>
9364
9365  </category>
9366
9367  <category id="eventManagement" label="Event Management">
9368
9369    <function id="SetEventCallbacks" jkernel="yes" phase="onload" num="122">
9370      <synopsis>Set Event Callbacks</synopsis>
9371      <description>
9372        Set the functions to be called for each event.
9373        The callbacks are specified by supplying a replacement function table.
9374        The function table is copied--changes to the local copy of the
9375        table have no effect.
9376        This is an atomic action, all callbacks are set at once.
9377        No events are sent before this function is called.
9378        When an entry is <code>NULL</code> or when the event is beyond
9379        <paramlink id="size_of_callbacks"></paramlink> no event is sent.
9380        Details on events are
9381        described <internallink id="EventSection">later</internallink> in this document.
9382        An event must be enabled and have a callback in order to be
9383        sent--the order in which this function and
9384        <functionlink id="SetEventNotificationMode"></functionlink>
9385        are called does not affect the result.
9386      </description>
9387      <origin>new</origin>
9388      <capabilities>
9389      </capabilities>
9390      <parameters>
9391        <param id="callbacks">
9392	  <inptr>
9393	    <struct>jvmtiEventCallbacks</struct>
9394	    <nullok>remove the existing callbacks</nullok>
9395	  </inptr>
9396	  <description>
9397	    The new event callbacks.
9398	  </description>
9399	</param>
9400        <param id="size_of_callbacks">
9401	  <jint min="0"/>
9402	  <description>
9403	    <code>sizeof(jvmtiEventCallbacks)</code>--for version
9404	    compatibility.
9405	  </description>
9406	</param>
9407      </parameters>
9408      <errors>
9409      </errors>
9410    </function>
9411
9412    <function id="SetEventNotificationMode" jkernel="yes" phase="onload" num="2">
9413      <synopsis>Set Event Notification Mode</synopsis>
9414      <description>
9415	Control the generation of events.
9416	<constants id="jvmtiEventMode" label="Event Enable/Disable" kind="enum">
9417	  <constant id="JVMTI_ENABLE" num="1">
9418	    If <paramlink id="mode"></paramlink> is <code>JVMTI_ENABLE</code>,
9419	    the event <paramlink id="event_type"></paramlink> will be enabled
9420	  </constant>
9421	  <constant id="JVMTI_DISABLE" num="0">
9422	    If <paramlink id="mode"></paramlink> is <code>JVMTI_DISABLE</code>,
9423	    the event <paramlink id="event_type"></paramlink> will be disabled
9424	  </constant>
9425	</constants>
9426	If <code>event_thread</code> is <code>NULL</code>,
9427	the event is enabled or disabled globally; otherwise, it is
9428	enabled or disabled for a particular thread.
9429	An event is generated for
9430	a particular thread if it is enabled either at the thread or global
9431	levels.
9432	<p/>
9433	See <internallink id="EventIndex">below</internallink> for information on specific events.
9434	<p/>
9435	The following events cannot be controlled at the thread
9436	level through this function.
9437	<ul>
9438	  <li><eventlink id="VMInit"></eventlink></li>
9439	  <li><eventlink id="VMStart"></eventlink></li>
9440	  <li><eventlink id="VMDeath"></eventlink></li>
9441	  <li><eventlink id="ThreadStart"></eventlink></li>
9442	  <li><eventlink id="CompiledMethodLoad"></eventlink></li>
9443	  <li><eventlink id="CompiledMethodUnload"></eventlink></li>
9444	  <li><eventlink id="DynamicCodeGenerated"></eventlink></li>
9445	  <li><eventlink id="DataDumpRequest"></eventlink></li>
9446	</ul>
9447	<p/>
9448	Initially, no events are enabled at either the thread level
9449	or the global level.
9450	<p/>
9451        Any needed capabilities (see Event Enabling Capabilities below) must be possessed
9452        before calling this function.
9453        <p/>
9454	Details on events are
9455	described <internallink id="EventSection">below</internallink>.
9456      </description>
9457      <origin>jvmdiClone</origin>
9458      <eventcapabilities></eventcapabilities>
9459      <parameters>
9460	<param id="mode">
9461	  <enum>jvmtiEventMode</enum>
9462	  <description>
9463	    <code>JVMTI_ENABLE</code> or <code>JVMTI_DISABLE</code>
9464	  </description>
9465	</param>
9466	<param id="event_type">
9467	  <enum>jvmtiEvent</enum>
9468	  <description>
9469	    the event to control
9470	  </description>
9471	</param>
9472	<param id="event_thread">
9473	  <ptrtype>
9474	    <jthread impl="noconvert"/>
9475	    <nullok>event is controlled at the global level</nullok>
9476	  </ptrtype>
9477	    <description>
9478	      The thread to control
9479	    </description>
9480	</param>
9481        <param id="...">
9482          <varargs/>
9483            <description>
9484              for future expansion
9485            </description>
9486        </param>
9487      </parameters>
9488      <errors>
9489        <error id="JVMTI_ERROR_INVALID_THREAD">
9490          <paramlink id="event_thread"/> is non-<code>NULL</code> and is not a valid thread.
9491        </error>
9492        <error id="JVMTI_ERROR_THREAD_NOT_ALIVE">
9493          <paramlink id="event_thread"/> is non-<code>NULL</code> and is not live (has not been started or is now dead).
9494        </error>
9495	<error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9496	  thread level control was attempted on events which do not
9497          permit thread level control.
9498	</error>
9499        <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY">
9500          The Required Event Enabling Capability is not possessed.
9501        </error>
9502      </errors>
9503    </function>
9504
9505    <function id="GenerateEvents" num="123">
9506      <synopsis>Generate Events</synopsis>
9507      <description>
9508        Generate events to represent the current state of the VM.
9509        For example, if <paramlink id="event_type"/> is
9510        <code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code>,
9511        a <eventlink id="CompiledMethodLoad"></eventlink> event will be
9512        sent for each currently compiled method.
9513        Methods that were loaded and now have been unloaded are not sent.
9514        The history of what events have previously been sent does not
9515        effect what events are sent by this function--for example,
9516        all currently compiled methods
9517        will be sent each time this function is called.
9518        <p/>
9519	This function is useful when
9520        events may have been missed due to the agent attaching after program
9521	execution begins; this function generates the missed events.
9522	<p/>
9523	Attempts to execute Java programming language code or
9524	JNI functions may be paused until this function returns -
9525	so neither should be called from the thread sending the event.
9526	This function returns only after the missed events have been
9527        sent, processed and have returned.
9528	The event may be sent on a different thread than the thread
9529	on which the event occurred.
9530	The callback for the event must be set with
9531        <functionlink id="SetEventCallbacks"></functionlink>
9532	and the event must be enabled with
9533        <functionlink id="SetEventNotificationMode"></functionlink>
9534	or the events will not occur.
9535	If the VM no longer has the information to generate some or
9536        all of the requested events, the events are simply not sent -
9537        no error is returned.
9538	<p/>
9539	Only the following events are supported:
9540	<ul>
9541	  <li><eventlink id="CompiledMethodLoad"></eventlink></li>
9542	  <li><eventlink id="DynamicCodeGenerated"></eventlink></li>
9543	</ul>
9544      </description>
9545      <origin>new</origin>
9546      <capabilities>
9547	<capability id="can_generate_compiled_method_load_events"></capability>
9548      </capabilities>
9549      <parameters>
9550	<param id="event_type">
9551	  <enum>jvmtiEvent</enum>
9552	  <description>
9553	    The type of event to generate.  Must be one of these:
9554	    <ul>
9555	      <li><eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink></li>
9556	      <li><eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink></li>
9557	    </ul>
9558	  </description>
9559	</param>
9560      </parameters>
9561      <errors>
9562        <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY">
9563          <paramlink id="event_type"/> is
9564	  <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink>
9565	  and <fieldlink id="can_generate_compiled_method_load_events" struct="jvmtiCapabilities"></fieldlink>
9566	  is <code>false</code>.
9567        </error>
9568        <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9569          <paramlink id="event_type"/> is other than
9570	  <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink>
9571	  or <eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink>.
9572        </error>
9573      </errors>
9574    </function>
9575
9576  </category>
9577
9578    <category id="extension" label="Extension Mechanism">
9579
9580      <intro>
9581	These functions
9582	allow a <jvmti/> implementation to provide functions and events
9583	beyond those defined in this specification.
9584	<p/>
9585	Both extension functions and extension events have parameters
9586	each of which has a 'type' and 'kind' chosen from the following tables:
9587
9588	<constants id="jvmtiParamTypes" label="Extension Function/Event Parameter Types" kind="enum">
9589	  <constant id="JVMTI_TYPE_JBYTE" num="101">
9590	    Java programming language primitive type - <code>byte</code>.
9591	    JNI type <code>jbyte</code>.
9592	  </constant>
9593	  <constant id="JVMTI_TYPE_JCHAR" num="102">
9594	    Java programming language primitive type - <code>char</code>.
9595	    JNI type <code>jchar</code>.
9596	  </constant>
9597	  <constant id="JVMTI_TYPE_JSHORT" num="103">
9598	    Java programming language primitive type - <code>short</code>.
9599	    JNI type <code>jshort</code>.
9600	  </constant>
9601	  <constant id="JVMTI_TYPE_JINT" num="104">
9602	    Java programming language primitive type - <code>int</code>.
9603	    JNI type <datalink id="jint"></datalink>.
9604	  </constant>
9605	  <constant id="JVMTI_TYPE_JLONG" num="105">
9606	    Java programming language primitive type - <code>long</code>.
9607	    JNI type <datalink id="jlong"></datalink>.
9608	  </constant>
9609	  <constant id="JVMTI_TYPE_JFLOAT" num="106">
9610	    Java programming language primitive type - <code>float</code>.
9611	    JNI type <datalink id="jfloat"></datalink>.
9612	  </constant>
9613	  <constant id="JVMTI_TYPE_JDOUBLE" num="107">
9614	    Java programming language primitive type - <code>double</code>.
9615	    JNI type <datalink id="jdouble"></datalink>.
9616	  </constant>
9617	  <constant id="JVMTI_TYPE_JBOOLEAN" num="108">
9618	    Java programming language primitive type - <code>boolean</code>.
9619	    JNI type <datalink id="jboolean"></datalink>.
9620	  </constant>
9621	  <constant id="JVMTI_TYPE_JOBJECT" num="109">
9622	    Java programming language object type - <code>java.lang.Object</code>.
9623	    JNI type <datalink id="jobject"></datalink>.
9624	    Returned values are JNI local references and must be managed.
9625	  </constant>
9626	  <constant id="JVMTI_TYPE_JTHREAD" num="110">
9627	    Java programming language object type - <code>java.lang.Thread</code>.
9628	    <jvmti/> type <datalink id="jthread"></datalink>.
9629	    Returned values are JNI local references and must be managed.
9630	  </constant>
9631	  <constant id="JVMTI_TYPE_JCLASS" num="111">
9632	    Java programming language object type - <code>java.lang.Class</code>.
9633	    JNI type <datalink id="jclass"></datalink>.
9634	    Returned values are JNI local references and must be managed.
9635	  </constant>
9636	  <constant id="JVMTI_TYPE_JVALUE" num="112">
9637	    Union of all Java programming language primitive and object types -
9638	    JNI type <datalink id="jvalue"></datalink>.
9639	    Returned values which represent object types are JNI local references and must be managed.
9640	  </constant>
9641	  <constant id="JVMTI_TYPE_JFIELDID" num="113">
9642	    Java programming language field identifier -
9643	    JNI type <datalink id="jfieldID"></datalink>.
9644	  </constant>
9645	  <constant id="JVMTI_TYPE_JMETHODID" num="114">
9646	    Java programming language method identifier -
9647	    JNI type <datalink id="jmethodID"></datalink>.
9648	  </constant>
9649	  <constant id="JVMTI_TYPE_CCHAR" num="115">
9650	    C programming language type - <code>char</code>.
9651	  </constant>
9652	  <constant id="JVMTI_TYPE_CVOID" num="116">
9653	    C programming language type - <code>void</code>.
9654	  </constant>
9655	  <constant id="JVMTI_TYPE_JNIENV" num="117">
9656	    JNI environment - <code>JNIEnv</code>.
9657            Should be used with the correct <datalink id="jvmtiParamKind"/> to make it a pointer type.
9658	  </constant>
9659	</constants>
9660
9661	<constants id="jvmtiParamKind" label="Extension Function/Event Parameter Kinds" kind="enum">
9662	  <constant id="JVMTI_KIND_IN" num="91">
9663	    Ingoing argument - <code>foo</code>.
9664	  </constant>
9665	  <constant id="JVMTI_KIND_IN_PTR" num="92">
9666	    Ingoing pointer argument - <code>const foo*</code>.
9667	  </constant>
9668	  <constant id="JVMTI_KIND_IN_BUF" num="93">
9669	    Ingoing array argument - <code>const foo*</code>.
9670	  </constant>
9671	  <constant id="JVMTI_KIND_ALLOC_BUF" num="94">
9672	    Outgoing allocated array argument -  <code>foo**</code>.
9673	    Free with <code>Deallocate</code>.
9674	  </constant>
9675	  <constant id="JVMTI_KIND_ALLOC_ALLOC_BUF" num="95">
9676	    Outgoing allocated array of allocated arrays argument - <code>foo***</code>.
9677	    Free with <code>Deallocate</code>.
9678	  </constant>
9679	  <constant id="JVMTI_KIND_OUT" num="96">
9680	    Outgoing argument - <code>foo*</code>.
9681	  </constant>
9682	  <constant id="JVMTI_KIND_OUT_BUF" num="97">
9683	    Outgoing array argument (pre-allocated by agent) - <code>foo*</code>.
9684	    Do not <code>Deallocate</code>.
9685	  </constant>
9686	</constants>
9687
9688      </intro>
9689
9690      <typedef id="jvmtiParamInfo" label="Extension Function/Event Parameter Info">
9691	<field id="name">
9692	  <allocfieldbuf><char/></allocfieldbuf>
9693	    <description>
9694	      The parameter name, encoded as a
9695	      <internallink id="mUTF">modified UTF-8</internallink> string
9696	    </description>
9697	</field>
9698	<field id="kind">
9699	  <enum>jvmtiParamKind</enum>
9700	  <description>
9701	    The kind of the parameter - type modifiers
9702	  </description>
9703	</field>
9704	<field id="base_type">
9705	  <enum>jvmtiParamTypes</enum>
9706	  <description>
9707	    The base type of the parameter -  modified by <code>kind</code>
9708	  </description>
9709	</field>
9710	<field id="null_ok">
9711	  <jboolean/>
9712	    <description>
9713	      Is a <code>NULL</code> argument permitted? Applies only to pointer and object types.
9714	    </description>
9715	</field>
9716      </typedef>
9717
9718      <callback id="jvmtiExtensionFunction">
9719	<enum>jvmtiError</enum>
9720	  <synopsis>Extension Function</synopsis>
9721	<description>
9722	  This is the implementation-specific extension function.
9723	</description>
9724	<parameters>
9725	  <param id="jvmti_env">
9726	    <outptr>
9727	      <struct>jvmtiEnv</struct>
9728	    </outptr>
9729	    <description>
9730	      The <jvmti/> environment is the only fixed parameter for extension functions.
9731	    </description>
9732	  </param>
9733	  <param id="...">
9734	    <varargs/>
9735	      <description>
9736		The extension function-specific parameters
9737	      </description>
9738	  </param>
9739	</parameters>
9740      </callback>
9741
9742      <function id="GetExtensionFunctions" phase="onload" num="124">
9743	<synopsis>Get Extension Functions</synopsis>
9744
9745	<typedef id="jvmtiExtensionFunctionInfo" label="Extension Function Info">
9746	  <field id="func">
9747            <ptrtype>
9748              <struct>jvmtiExtensionFunction</struct>
9749            </ptrtype>
9750	    <description>
9751	      The actual function to call
9752	    </description>
9753	  </field>
9754	  <field id="id">
9755	    <allocfieldbuf><char/></allocfieldbuf>
9756	      <description>
9757		The identifier for the extension function, encoded as a
9758	        <internallink id="mUTF">modified UTF-8</internallink> string.
9759		Uses package name conventions.
9760		For example, <code>com.sun.hotspot.bar</code>
9761	      </description>
9762	  </field>
9763	  <field id="short_description">
9764	    <allocfieldbuf><char/></allocfieldbuf>
9765	      <description>
9766		A one sentence description of the function, encoded as a
9767	        <internallink id="mUTF">modified UTF-8</internallink> string.
9768	      </description>
9769	  </field>
9770	  <field id="param_count">
9771	    <jint/>
9772	      <description>
9773		The number of parameters excluding <code>jvmtiEnv *jvmti_env</code>
9774	      </description>
9775	  </field>
9776	  <field id="params">
9777	    <allocfieldbuf outcount="param_count">
9778	      <struct>jvmtiParamInfo</struct>
9779	    </allocfieldbuf>
9780	    <description>
9781	      Array of
9782	      <fieldlink id="param_count" struct="jvmtiExtensionFunctionInfo"></fieldlink>
9783	      parameters (<code>jvmtiEnv *jvmti_env</code> excluded)
9784	    </description>
9785	  </field>
9786	  <field id="error_count">
9787	    <jint/>
9788	      <description>
9789		The number of possible error returns (excluding universal errors)
9790	      </description>
9791	  </field>
9792	  <field id="errors">
9793	    <allocfieldbuf outcount="error_count">
9794	      <enum>jvmtiError</enum>
9795	    </allocfieldbuf>
9796	    <description>
9797	      Array of <fieldlink id="error_count" struct="jvmtiExtensionFunctionInfo"></fieldlink>
9798	      possible errors
9799	    </description>
9800	  </field>
9801	</typedef>
9802
9803	<description>
9804	  Returns the set of extension functions.
9805	</description>
9806	<origin>new</origin>
9807	<capabilities>
9808	</capabilities>
9809	<parameters>
9810	  <param id="extension_count_ptr">
9811	    <outptr><jint/></outptr>
9812	      <description>
9813		On return, points to the number of extension functions
9814	      </description>
9815	  </param>
9816	  <param id="extensions">
9817	    <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionFunctionInfo</struct></allocbuf>
9818	    <description>
9819	      Returns an array of extension function info, one per function
9820	    </description>
9821	  </param>
9822	</parameters>
9823	<errors>
9824	</errors>
9825      </function>
9826
9827      <function id="GetExtensionEvents" phase="onload" num="125">
9828	<synopsis>Get Extension Events</synopsis>
9829
9830	<typedef id="jvmtiExtensionEventInfo" label="Extension Event Info">
9831	  <field id="extension_event_index">
9832	    <jint/>
9833	    <description>
9834	      The identifying index of the event
9835	    </description>
9836	  </field>
9837	  <field id="id">
9838	    <allocfieldbuf><char/></allocfieldbuf>
9839	      <description>
9840		The identifier for the extension event, encoded as a
9841                <internallink id="mUTF">modified UTF-8</internallink> string.
9842		Uses package name conventions.
9843		For example, <code>com.sun.hotspot.bar</code>
9844	      </description>
9845	  </field>
9846	  <field id="short_description">
9847	    <allocfieldbuf><char/></allocfieldbuf>
9848	      <description>
9849		A one sentence description of the event, encoded as a
9850                <internallink id="mUTF">modified UTF-8</internallink> string.
9851	      </description>
9852	  </field>
9853	  <field id="param_count">
9854	    <jint/>
9855	      <description>
9856		The number of parameters excluding <code>jvmtiEnv *jvmti_env</code>
9857	      </description>
9858	  </field>
9859	  <field id="params">
9860	    <allocfieldbuf outcount="param_count">
9861	      <struct>jvmtiParamInfo</struct>
9862	    </allocfieldbuf>
9863	    <description>
9864	      Array of
9865	      <fieldlink id="param_count" struct="jvmtiExtensionEventInfo"></fieldlink>
9866	      parameters (<code>jvmtiEnv *jvmti_env</code> excluded)
9867	    </description>
9868	  </field>
9869	</typedef>
9870
9871	<description>
9872	  Returns the set of extension events.
9873	</description>
9874	<origin>new</origin>
9875	<capabilities>
9876	</capabilities>
9877	<parameters>
9878	  <param id="extension_count_ptr">
9879	    <outptr><jint/></outptr>
9880	      <description>
9881		On return, points to the number of extension events
9882	      </description>
9883	  </param>
9884	  <param id="extensions">
9885	    <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionEventInfo</struct></allocbuf>
9886	    <description>
9887	      Returns an array of extension event info, one per event
9888	    </description>
9889	  </param>
9890	</parameters>
9891	<errors>
9892	</errors>
9893      </function>
9894
9895      <callback id="jvmtiExtensionEvent">
9896	<void/>
9897	  <synopsis>Extension Event</synopsis>
9898	<description>
9899	  This is the implementation-specific event.
9900          The event handler is set with
9901          <functionlink id="SetExtensionEventCallback"/>.
9902          <p/>
9903          Event handlers for extension events must be declared varargs to match this definition.
9904          Failure to do so could result in calling convention mismatch and undefined behavior
9905          on some platforms.
9906          <p/>
9907          For example, if the <code>jvmtiParamInfo</code>
9908          returned by <functionlink id="GetExtensionEvents"/> indicates that
9909          there is a <code>jint</code> parameter, the event handler should be
9910          declared:
9911<example>
9912    void JNICALL myHandler(jvmtiEnv* jvmti_env, ...)
9913</example>
9914          Note the terminal "<code>...</code>" which indicates varargs.
9915          The <code>jint</code> argument inside <code>myHandler</code> needs to be extracted using
9916          the <code>va_*</code> syntax of the C programming language.
9917	</description>
9918	<parameters>
9919	  <param id="jvmti_env">
9920	    <outptr>
9921	      <struct>jvmtiEnv</struct>
9922	    </outptr>
9923	    <description>
9924	      The <jvmti/> environment is the only fixed parameter for extension events.
9925	    </description>
9926	  </param>
9927	  <param id="...">
9928	    <varargs/>
9929	      <description>
9930		The extension event-specific parameters
9931	      </description>
9932	  </param>
9933	</parameters>
9934      </callback>
9935
9936      <function id="SetExtensionEventCallback" phase="onload" num="126">
9937	<synopsis>Set Extension Event Callback</synopsis>
9938
9939	<description>
9940	  Sets the callback function for an extension event and
9941	  enables the event. Or, if the callback is <code>NULL</code>, disables
9942	  the event.  Note that unlike standard events, setting
9943	  the callback and enabling the event are a single operation.
9944	</description>
9945	<origin>new</origin>
9946	<capabilities>
9947	</capabilities>
9948	<parameters>
9949	  <param id="extension_event_index">
9950	    <jint/>
9951	      <description>
9952		Identifies which callback to set.
9953		This index is the
9954		<fieldlink id="extension_event_index" struct="jvmtiExtensionEventInfo"></fieldlink>
9955		field of
9956		<datalink id="jvmtiExtensionEventInfo"/>.
9957	      </description>
9958	  </param>
9959	  <param id="callback">
9960	    <ptrtype>
9961	      <struct>jvmtiExtensionEvent</struct>
9962	      <nullok>disable the event</nullok>
9963	    </ptrtype>
9964	    <description>
9965	      If <code>callback</code> is non-<code>NULL</code>,
9966	      set <code>callback</code> to be the event callback function
9967	      and enable the event.
9968	    </description>
9969	  </param>
9970	</parameters>
9971	<errors>
9972        <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9973            <paramlink id="extension_event_index"/> is not an
9974            <fieldlink id="extension_event_index"
9975                       struct="jvmtiExtensionEventInfo"/>
9976            returned by
9977            <functionlink id="GetExtensionEvents"/>
9978        </error>
9979	</errors>
9980      </function>
9981
9982    </category>
9983
9984  <category id="capability" label="Capability">
9985
9986    <intro>
9987      The capabilities functions allow you to change the
9988      functionality available to <jvmti/>--that is,
9989      which <jvmti/>
9990      functions can be called, what events can be generated,
9991      and what functionality these events and functions can
9992      provide.
9993      <p/>
9994        The "Capabilities" section of each function and event describe which
9995        capabilities, if any, they are associated with. "Required Functionality"
9996        means it is available for use and no capabilities must be added to use it.
9997        "Optional Functionality" means the agent must possess the capability
9998        before it can be used.
9999        To possess a capability, the agent must
10000        <functionlink id="AddCapabilities">add the capability</functionlink>.
10001        "Optional Features" describe capabilities which,
10002        if added, extend the feature set.
10003        <p/>
10004        The potentially available capabilities of each <jvmti/> implementation are different.
10005        Depending on the implementation, a capability:
10006        <ul>
10007          <li>may never be added</li>
10008          <li>may be added in either the <code>OnLoad</code> or live phase in any environment</li>
10009          <li>may be added only during the <code>OnLoad</code> phase</li>
10010          <li>may be possessed by only one environment at a time</li>
10011          <li>may be possessed by only one environment at a time,
10012              and only during the <code>OnLoad</code> phase</li>
10013          <li>and so on ...</li>
10014        </ul>
10015      Frequently, the addition of a capability may incur a cost in execution speed, start up
10016      time, and/or memory footprint.  Note that the overhead of using a capability
10017      is completely different than the overhead of possessing a capability.
10018      Take single stepping as an example. When single stepping is on (that
10019      is, when the event is enabled and thus actively sending events)
10020      the overhead of sending and processing an event
10021      on each instruction is huge in any implementation.
10022      However, the overhead of possessing the capability may be small or large,
10023      depending on the implementation.  Also, when and if a capability is potentially
10024      available depends on the implementation.  Some examples:
10025      <ul>
10026	<li>One VM might perform all execution by compiling bytecodes into
10027	  native code and be unable to generate single step instructions.
10028	  In this implementation the capability can not be added.</li>
10029	<li>Another VM may be able to switch execution to a single stepping
10030	  interpreter at any time.  In this implementation, having the capability has no
10031	  overhead and could be added at any time.</li>
10032	<li>Yet another VM might be able to choose a bytecode compiling or single stepping capable interpreted
10033	  execution engine at start up, but be unable to switch between them.
10034	  In this implementation the capability would need to be added
10035          during the <code>OnLoad</code> phase (before bytecode
10036	  execution begins) and would have a large impact on execution speed
10037	  even if single stepping was never used.</li>
10038	<li>Still another VM might be able to add an "is single stepping on" check
10039	  into compiled bytecodes or a generated interpreter.  Again in this implementation
10040	  the capability would need to be added during the <code>OnLoad</code> phase but the overhead (a test
10041	  and branch on each instruction) would be considerably less.</li>
10042      </ul>
10043      <p/>
10044      Each <jvmti/> <internallink id="environments">environment</internallink>
10045      has its own set of capabilities.
10046      Initially, that set is empty.
10047      Any desired capability must be added.
10048      If possible, capabilities should be added during the <code>OnLoad</code> phase.  For most
10049      virtual machines certain capabilities require special set up for
10050      the virtual machine and this set up must happen
10051      during the <code>OnLoad</code> phase, before the virtual machine begins execution.
10052      Once a capability is added, it can
10053      only be removed if explicitly relinquished by the environment.
10054      <p/>
10055      The agent can,
10056      <functionlink id="GetPotentialCapabilities">determine what
10057	capabilities this VM can potentially provide</functionlink>,
10058      <functionlink id="AddCapabilities">add the capabilities
10059	to be used</functionlink>,
10060      <functionlink id="RelinquishCapabilities">release capabilities
10061	which are no longer needed</functionlink>, and
10062      <functionlink id="GetCapabilities">examine the currently available
10063	capabilities</functionlink>.
10064    </intro>
10065
10066    <intro id="capabilityExamples" label="Capability Examples">
10067      For example, a freshly started agent (in the <code>OnLoad</code> function)
10068      wants to enable all possible capabilities.
10069      Note that, in general, this is not advisable as the agent may suffer
10070      a performance penalty for functionality it is not using.
10071      The code might look like this in C:
10072      <example>
10073	jvmtiCapabilities capa;
10074	jvmtiError err;
10075
10076	err = (*jvmti)-&gt;GetPotentialCapabilities(jvmti, &amp;capa);
10077	if (err == JVMTI_ERROR_NONE) {
10078	   err = (*jvmti)-&gt;AddCapabilities(jvmti, &amp;capa);
10079      </example>
10080      For example, if an  agent wants to check if it can get
10081      the bytecodes of a method (that is, it wants to check
10082      if it previously added this capability and has not
10083      relinquished it), the code might
10084      look like this in C:
10085      <example>
10086	jvmtiCapabilities capa;
10087	jvmtiError err;
10088
10089	err = (*jvmti)-&gt;GetCapabilities(jvmti, &amp;capa);
10090	if (err == JVMTI_ERROR_NONE) {
10091   	   if (capa.can_get_bytecodes) { ... } }
10092      </example>
10093    </intro>
10094
10095    <capabilitiestypedef id="jvmtiCapabilities" label="The Capabilities Structure">
10096      <description>
10097        The functions in this category use this capabilities structure
10098        which contains boolean flags corresponding to each capability:
10099      </description>
10100      <capabilityfield id="can_tag_objects">
10101	<description>
10102	  Can set and get tags, as described in the
10103          <internallink id="Heap">Heap category</internallink>.
10104	</description>
10105      </capabilityfield>
10106      <capabilityfield id="can_generate_field_modification_events">
10107	<description>
10108	  Can set watchpoints on field modification -
10109          <functionlink id="SetFieldModificationWatch"></functionlink>
10110	</description>
10111      </capabilityfield>
10112      <capabilityfield id="can_generate_field_access_events">
10113	<description>
10114	  Can set watchpoints on field access -
10115	  <functionlink id="SetFieldAccessWatch"></functionlink>
10116	</description>
10117      </capabilityfield>
10118      <capabilityfield id="can_get_bytecodes">
10119	<description>
10120	  Can get bytecodes of a method <functionlink id="GetBytecodes"></functionlink>
10121	</description>
10122      </capabilityfield>
10123      <capabilityfield id="can_get_synthetic_attribute">
10124	<description>
10125	  Can test if a field or method is synthetic -
10126          <functionlink id="IsFieldSynthetic"></functionlink> and
10127          <functionlink id="IsMethodSynthetic"></functionlink>
10128	</description>
10129      </capabilityfield>
10130      <capabilityfield id="can_get_owned_monitor_info">
10131	<description>
10132	  Can get information about ownership of monitors -
10133          <functionlink id="GetOwnedMonitorInfo"></functionlink>
10134	</description>
10135      </capabilityfield>
10136      <capabilityfield id="can_get_current_contended_monitor">
10137	<description>
10138	  Can <functionlink id="GetCurrentContendedMonitor"></functionlink>
10139	</description>
10140      </capabilityfield>
10141      <capabilityfield id="can_get_monitor_info">
10142      <description>
10143        Can <functionlink id="GetObjectMonitorUsage"></functionlink>
10144      </description>
10145      </capabilityfield>
10146      <capabilityfield id="can_pop_frame">
10147	<description>
10148	  Can pop frames off the stack - <functionlink id="PopFrame"></functionlink>
10149	</description>
10150      </capabilityfield>
10151      <capabilityfield id="can_redefine_classes">
10152	<description>
10153	  Can redefine classes with <functionlink id="RedefineClasses"/>.
10154	</description>
10155      </capabilityfield>
10156      <capabilityfield id="can_signal_thread">
10157	<description>
10158	  Can send stop or interrupt to threads
10159	</description>
10160      </capabilityfield>
10161      <capabilityfield id="can_get_source_file_name">
10162	<description>
10163	  Can get the source file name of a class
10164	</description>
10165      </capabilityfield>
10166      <capabilityfield id="can_get_line_numbers">
10167	<description>
10168	  Can get the line number table of a method
10169	</description>
10170      </capabilityfield>
10171      <capabilityfield id="can_get_source_debug_extension">
10172	<description>
10173	  Can get the source debug extension of a class
10174	</description>
10175      </capabilityfield>
10176      <capabilityfield id="can_access_local_variables">
10177	<description>
10178	  Can set and get local variables
10179	</description>
10180      </capabilityfield>
10181      <capabilityfield id="can_maintain_original_method_order">
10182	<description>
10183	  Can return methods in the order they occur in the class file
10184	</description>
10185      </capabilityfield>
10186      <capabilityfield id="can_generate_single_step_events">
10187	<description>
10188	  Can get <eventlink id="SingleStep">single step</eventlink> events
10189	</description>
10190      </capabilityfield>
10191      <capabilityfield id="can_generate_exception_events">
10192	<description>
10193	  Can get <eventlink id="Exception">exception thrown</eventlink> and
10194            <eventlink id="ExceptionCatch">exception catch</eventlink> events
10195	</description>
10196      </capabilityfield>
10197      <capabilityfield id="can_generate_frame_pop_events">
10198	<description>
10199	  Can <functionlink id="NotifyFramePop">set</functionlink> and thus get
10200            <eventlink id="FramePop"></eventlink> events
10201	</description>
10202      </capabilityfield>
10203      <capabilityfield id="can_generate_breakpoint_events">
10204	<description>
10205	  Can <functionlink id="SetBreakpoint">set</functionlink> and thus get
10206            <eventlink id="Breakpoint"></eventlink> events
10207	</description>
10208      </capabilityfield>
10209      <capabilityfield id="can_suspend">
10210	<description>
10211	  Can suspend and resume threads
10212	</description>
10213      </capabilityfield>
10214      <capabilityfield id="can_redefine_any_class">
10215	<description>
10216          Can modify (retransform or redefine) any modifiable class.
10217          See <functionlink id="IsModifiableClass"/>.
10218	</description>
10219      </capabilityfield>
10220      <capabilityfield id="can_get_current_thread_cpu_time">
10221	<description>
10222	  Can <functionlink id="GetCurrentThreadCpuTime">get</functionlink>
10223	  current thread CPU time
10224	</description>
10225      </capabilityfield>
10226      <capabilityfield id="can_get_thread_cpu_time">
10227	<description>
10228	  Can <functionlink id="GetThreadCpuTime">get</functionlink>
10229	  thread CPU time
10230	</description>
10231      </capabilityfield>
10232      <capabilityfield id="can_generate_method_entry_events"
10233		       disp1="can_generate" disp2="_method_entry_events"
10234		       >
10235	<description>
10236	  Can generate method entry events on entering a method
10237	</description>
10238      </capabilityfield>
10239      <capabilityfield id="can_generate_method_exit_events"
10240		       disp1="can_generate" disp2="_method_exit_events"
10241		       >
10242	<description>
10243	  Can generate method exit events on leaving a method
10244	</description>
10245      </capabilityfield>
10246      <capabilityfield id="can_generate_all_class_hook_events"
10247		       disp1="can_generate" disp2="_all_class_hook_events"
10248		       >
10249	<description>
10250	  Can generate ClassFileLoadHook events for every loaded class.
10251	</description>
10252      </capabilityfield>
10253      <capabilityfield id="can_generate_compiled_method_load_events"
10254		       disp1="can_generate" disp2="_compiled_method_load_events"
10255		       >
10256	<description>
10257	  Can generate events when a method is compiled or unloaded
10258	</description>
10259      </capabilityfield>
10260      <capabilityfield id="can_generate_monitor_events"
10261		       disp1="can_generate" disp2="_monitor_events"
10262		       >
10263	<description>
10264	  Can generate events on monitor activity
10265	</description>
10266      </capabilityfield>
10267      <capabilityfield id="can_generate_vm_object_alloc_events"
10268		       disp1="can_generate" disp2="_vm_object_alloc_events"
10269		       >
10270	<description>
10271	  Can generate events on VM allocation of an object
10272	</description>
10273      </capabilityfield>
10274      <capabilityfield id="can_generate_native_method_bind_events"
10275		       disp1="can_generate" disp2="_native_method_bind_events"
10276		       >
10277	<description>
10278	  Can generate events when a native method is bound to its
10279	  implementation
10280	</description>
10281      </capabilityfield>
10282      <capabilityfield id="can_generate_garbage_collection_events"
10283		       disp1="can_generate" disp2="_garbage_collection_events"
10284		       >
10285	<description>
10286	  Can generate events when garbage collection begins or ends
10287	</description>
10288      </capabilityfield>
10289      <capabilityfield id="can_generate_object_free_events"
10290		       disp1="can_generate" disp2="_object_free_events"
10291		       >
10292	<description>
10293	  Can generate events when the garbage collector frees an object
10294	</description>
10295      </capabilityfield>
10296      <capabilityfield id="can_force_early_return" since="1.1">
10297	<description>
10298	  Can return early from a method, as described in the
10299          <internallink id="ForceEarlyReturn">Force Early Return category</internallink>.
10300	</description>
10301      </capabilityfield>
10302      <capabilityfield id="can_get_owned_monitor_stack_depth_info" since="1.1">
10303	<description>
10304	  Can get information about owned monitors with stack depth -
10305          <functionlink id="GetOwnedMonitorStackDepthInfo"></functionlink>
10306	</description>
10307      </capabilityfield>
10308      <capabilityfield id="can_get_constant_pool" since="1.1">
10309	<description>
10310	  Can get the constant pool of a class -
10311          <functionlink id="GetConstantPool"></functionlink>
10312	</description>
10313      </capabilityfield>
10314      <capabilityfield id="can_set_native_method_prefix" since="1.1">
10315	<description>
10316	  Can set prefix to be applied when native method cannot be resolved -
10317          <functionlink id="SetNativeMethodPrefix"/> and
10318          <functionlink id="SetNativeMethodPrefixes"/>
10319	</description>
10320      </capabilityfield>
10321      <capabilityfield id="can_retransform_classes" since="1.1">
10322	<description>
10323	  Can retransform classes with <functionlink id="RetransformClasses"/>.
10324          In addition to the restrictions imposed by the specific
10325          implementation on this capability (see the
10326          <internallink id="capability">Capability</internallink> section),
10327          this capability must be set before the
10328          <eventlink id="ClassFileLoadHook"/> event is enabled for the
10329          first time in this environment.
10330          An environment that possesses this capability at the time that
10331          <code>ClassFileLoadHook</code> is enabled for the first time is
10332          said to be <i>retransformation capable</i>.
10333          An environment that does not possess this capability at the time that
10334          <code>ClassFileLoadHook</code> is enabled for the first time is
10335          said to be <i>retransformation incapable</i>.
10336	</description>
10337      </capabilityfield>
10338      <capabilityfield id="can_retransform_any_class" since="1.1">
10339	<description>
10340          <functionlink id="RetransformClasses"/> can be called on any modifiable class.
10341          See <functionlink id="IsModifiableClass"/>.
10342          (<fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/>
10343          must also be set)
10344	</description>
10345      </capabilityfield>
10346      <capabilityfield id="can_generate_resource_exhaustion_heap_events" since="1.1">
10347	<description>
10348          Can generate events when the VM is unable to allocate memory from
10349          the <tm>Java</tm> platform heap.
10350          See <eventlink id="ResourceExhausted"/>.
10351	</description>
10352      </capabilityfield>
10353      <capabilityfield id="can_generate_resource_exhaustion_threads_events" since="1.1">
10354	<description>
10355          Can generate events when the VM is unable to create a thread.
10356          See <eventlink id="ResourceExhausted"/>.
10357	</description>
10358      </capabilityfield>
10359      <capabilityfield id="can_generate_early_vmstart" since="9">
10360        <description>
10361          Can generate the <code>VMStart</code> event early.
10362          See <eventlink id="VMStart"/>.
10363        </description>
10364      </capabilityfield>
10365      <capabilityfield id="can_generate_early_class_hook_events" since="9">
10366        <description>
10367          Can generate the <eventlink id="ClassFileLoadHook"/> events
10368          in the primordial phase. If this capability and
10369          <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
10370          <code>can_generate_all_class_hook_events</code></internallink>
10371          are enabled then the <eventlink id="ClassFileLoadHook"/> events
10372          can be posted for classes loaded in the primordial phase.
10373          See <eventlink id="ClassFileLoadHook"/>.
10374        </description>
10375      </capabilityfield>
10376      <capabilityfield id="can_generate_sampled_object_alloc_events" since="11">
10377        <description>
10378          Can generate sampled allocation events.
10379          If this capability is enabled then the heap sampling method
10380	  <functionlink id="SetHeapSamplingInterval"></functionlink> can be
10381	  called and <eventlink id="SampledObjectAlloc"></eventlink> events can be generated.
10382        </description>
10383      </capabilityfield>
10384    </capabilitiestypedef>
10385
10386    <function id="GetPotentialCapabilities" jkernel="yes" phase="onload" num="140">
10387      <synopsis>Get Potential Capabilities</synopsis>
10388      <description>
10389        Returns via <paramlink id="capabilities_ptr"></paramlink> the <jvmti/>
10390        features that can potentially be possessed by this environment
10391	at this time.
10392	The returned capabilities differ from the complete set of capabilities
10393	implemented by the VM in two cases: another environment possesses
10394	capabilities that can only be possessed by one environment, or the
10395	current <functionlink id="GetPhase">phase</functionlink> is live,
10396	and certain capabilities can only be added during the <code>OnLoad</code> phase.
10397        The <functionlink id="AddCapabilities"></functionlink> function
10398        may be used to set any or all or these capabilities.
10399        Currently possessed capabilities are included.
10400        <p/>
10401        Typically this function is used in the <code>OnLoad</code> function.
10402        Some virtual machines may allow a limited set of capabilities to be
10403        added in the live phase.
10404        In this case, the set of potentially available capabilities
10405        will likely differ from the <code>OnLoad</code> phase set.
10406        <p/>
10407        See the
10408        <internallink id="capabilityExamples">Capability Examples</internallink>.
10409      </description>
10410      <origin>new</origin>
10411      <capabilities>
10412      </capabilities>
10413      <parameters>
10414        <param id="capabilities_ptr">
10415	  <outptr><struct>jvmtiCapabilities</struct></outptr>
10416	  <description>
10417	    On return, points to the <jvmti/> capabilities that may be added.
10418	  </description>
10419	</param>
10420      </parameters>
10421      <errors>
10422      </errors>
10423    </function>
10424
10425    <elide>
10426    <function id="EstimateCostOfCapabilities" phase="onload" num="141">
10427      <synopsis>Estimate Cost Of Capabilities</synopsis>
10428      <description>
10429	<issue>There is strong opposition to this function.  The concern is
10430	  that it would be difficult or impossible to provide meaningful
10431	  numbers, as the amount of impact is conditional on many factors
10432	  that a single number could not represent.  There is doubt that
10433	  conditional implementations would be used or are even a good idea.
10434	  The thought is that release documentation for the implementation
10435	  would be the best means of exposing this information.
10436	  Unless new arguments are presented, I intend to remove this
10437	  function in the next revision.
10438	</issue>
10439        <p/>
10440        Return via the <paramlink id="time_impact_ptr"></paramlink> and
10441        <paramlink id="space_impact_ptr"></paramlink> an estimate of the impact
10442        of adding the capabilities pointed to by
10443        <paramlink id="capabilities_ptr"></paramlink>.
10444        The returned estimates are in percentage of additional overhead, thus
10445        a time impact of 100 mean the application might run
10446        at half the speed.
10447        The estimates are very rough approximations and are not guaranteed.
10448        Note also, that the estimates are of the impact of having the
10449        capability available--when and if it is used the impact may be
10450        much greater.
10451        Estimates can be for a single capability or for a set of
10452        capabilities.  Note that the costs are not necessarily additive,
10453        adding support for one capability might make another available
10454        for free or conversely having two capabilities at once may
10455        have multiplicative impact.
10456        Estimates are relative to the current set of capabilities -
10457        that is, how much more impact given the currently possessed capabilities.
10458        <p/>
10459        Typically this function is used in the OnLoad function,
10460        some virtual machines may allow a limited set of capabilities to be
10461        added in the live phase.
10462        In this case, the set of potentially available capabilities
10463        will likely differ from the OnLoad phase set.
10464        <p/>
10465        See the
10466        <internallink id="capabilityExamples">Capability Examples</internallink>.
10467      </description>
10468      <origin>new</origin>
10469      <capabilities>
10470      </capabilities>
10471      <parameters>
10472        <param id="capabilities_ptr">
10473	  <inptr><struct>jvmtiCapabilities</struct></inptr>
10474	  <description>
10475	    points to the <jvmti/> capabilities to evaluate.
10476	  </description>
10477	</param>
10478        <param id="time_impact_ptr">
10479	  <outptr><jint/></outptr>
10480	  <description>
10481	    On return, points to the estimated percentage increase in
10482	    run time if this capability was added.
10483	  </description>
10484	</param>
10485        <param id="space_impact_ptr">
10486	  <outptr><jint/></outptr>
10487	  <description>
10488	    On return, points to the estimated percentage increase in
10489	    memory space used if this capability was added.
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    </elide>
10500
10501    <function id="AddCapabilities" jkernel="yes" phase="onload" num="142">
10502      <synopsis>Add Capabilities</synopsis>
10503      <description>
10504        Set new capabilities by adding the capabilities
10505        whose values are set to one (<code>1</code>) in
10506        <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10507        All previous capabilities are retained.
10508        Typically this function is used in the <code>OnLoad</code> function.
10509        Some virtual machines may allow a limited set of capabilities to be
10510        added in the live phase.
10511        <p/>
10512        See the
10513        <internallink id="capabilityExamples">Capability Examples</internallink>.
10514      </description>
10515      <origin>new</origin>
10516      <capabilities>
10517      </capabilities>
10518      <parameters>
10519        <param id="capabilities_ptr">
10520	  <inptr><struct>jvmtiCapabilities</struct></inptr>
10521	  <description>
10522	    Points to the <jvmti/> capabilities to add.
10523	  </description>
10524	</param>
10525      </parameters>
10526      <errors>
10527        <error id="JVMTI_ERROR_NOT_AVAILABLE">
10528          The desired capabilities are not even potentially available.
10529        </error>
10530      </errors>
10531    </function>
10532
10533
10534    <function id="RelinquishCapabilities" phase="onload" num="143">
10535      <synopsis>Relinquish Capabilities</synopsis>
10536      <description>
10537        Relinquish the capabilities
10538        whose values are set to one (<code>1</code>) in
10539        <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10540	Some implementations may allow only one environment to have a capability
10541	(see the <internallink id="capability">capability introduction</internallink>).
10542	This function releases capabilities
10543	so that they may be used by other agents.
10544        All other capabilities are retained.
10545        The capability will no longer be present in <functionlink id="GetCapabilities"></functionlink>.
10546	Attempting to relinquish a capability that the agent does not possess is not an error.
10547          <issue>
10548            It is possible for the agent to be actively using capabilities
10549            which are being relinquished.  For example, a thread is currently
10550            suspended and can_suspend is being relinquished or an event is currently
10551            enabled and can_generate_whatever is being relinquished.
10552            There are three possible ways we could spec this:
10553            <ul>
10554              <li>relinquish automatically releases them</li>
10555              <li>relinquish checks and returns some error code if held</li>
10556              <li>it is the agent's responsibility and it is not checked</li>
10557            </ul>
10558            One of these should be chosen.
10559          </issue>
10560      </description>
10561      <origin>new</origin>
10562      <capabilities>
10563      </capabilities>
10564      <parameters>
10565        <param id="capabilities_ptr">
10566	  <inptr><struct>jvmtiCapabilities</struct></inptr>
10567	  <description>
10568	    Points to the <jvmti/> capabilities to relinquish.
10569	  </description>
10570	</param>
10571      </parameters>
10572      <errors>
10573      </errors>
10574    </function>
10575
10576
10577
10578    <function id="GetCapabilities" jkernel="yes" phase="any" num="89">
10579      <synopsis>Get Capabilities</synopsis>
10580        <description>
10581          Returns via <paramlink id="capabilities_ptr"></paramlink> the optional <jvmti/>
10582          features which this environment currently possesses.
10583          Each possessed capability is indicated by a one (<code>1</code>) in the
10584          corresponding field of the <internallink id="jvmtiCapabilities">capabilities
10585          structure</internallink>.
10586          An environment does not possess a capability unless it has been successfully added with
10587          <functionlink id="AddCapabilities"/>.
10588          An environment only loses possession of a capability if it has been relinquished with
10589          <functionlink id="RelinquishCapabilities"/>. Thus, this function returns the net result
10590          of the <code>AddCapabilities</code> and <code>RelinquishCapabilities</code> calls which
10591          have been made.
10592          <p/>
10593          See the
10594          <internallink id="capabilityExamples">Capability Examples</internallink>.
10595        </description>
10596      <origin>jvmdiClone</origin>
10597      <capabilities>
10598      </capabilities>
10599      <parameters>
10600        <param id="capabilities_ptr">
10601	  <outptr><struct>jvmtiCapabilities</struct></outptr>
10602	  <description>
10603	    On return, points to the <jvmti/> capabilities.
10604	  </description>
10605	</param>
10606      </parameters>
10607      <errors>
10608      </errors>
10609    </function>
10610
10611  </category>
10612
10613
10614  <category id="timers" label="Timers">
10615
10616      <intro>
10617	These functions provide timing information.
10618	The resolution at which the time is updated is not specified.
10619	They provides nanosecond precision, but not necessarily nanosecond accuracy.
10620	Details about the timers, such as their maximum values, can be accessed with
10621	the timer information functions.
10622      </intro>
10623
10624      <typedef id="jvmtiTimerInfo" label="Timer Info">
10625        <description>
10626          The information function for each timer returns this data structure.
10627        </description>
10628	<field id="max_value">
10629	  <jlong/>
10630	    <description>
10631	      The maximum value the timer can reach.
10632	      After this value is reached the timer wraps back to zero.
10633              This is an unsigned value.  If tested or printed as a jlong (signed value)
10634              it may appear to be a negative number.
10635	    </description>
10636	</field>
10637	<field id="may_skip_forward">
10638	  <jboolean/>
10639	  <description>
10640	    If true, the timer can be externally adjusted and as a result skip forward.
10641	    If false, the timer value will never increase faster than real time.
10642	  </description>
10643	</field>
10644	<field id="may_skip_backward">
10645	  <jboolean/>
10646	  <description>
10647	    If true, the timer can be externally adjusted and as a result skip backward.
10648	    If false, the timer value will be monotonically increasing.
10649	  </description>
10650	</field>
10651	<field id="kind">
10652	  <enum>jvmtiTimerKind</enum>
10653	  <description>
10654	    The kind of timer.
10655            On a platform that does not distinguish between user and system time, <datalink
10656                 id="JVMTI_TIMER_TOTAL_CPU"><code>JVMTI_TIMER_TOTAL_CPU</code></datalink>
10657            is returned.
10658	  </description>
10659	</field>
10660	<field id="reserved1">
10661	  <jlong/>
10662	    <description>
10663	      Reserved for future use.
10664	    </description>
10665	</field>
10666	<field id="reserved2">
10667	  <jlong/>
10668	    <description>
10669	      Reserved for future use.
10670	    </description>
10671	</field>
10672      </typedef>
10673
10674      <intro>
10675	Where the timer kind is --
10676
10677        <constants id="jvmtiTimerKind" label="Timer Kinds" kind="enum">
10678          <constant id="JVMTI_TIMER_USER_CPU" num="30">
10679            CPU time that a thread is in user mode.
10680          </constant>
10681          <constant id="JVMTI_TIMER_TOTAL_CPU" num="31">
10682            CPU time that a thread is in user or system mode.
10683          </constant>
10684          <constant id="JVMTI_TIMER_ELAPSED" num="32">
10685            Elapsed time.
10686          </constant>
10687        </constants>
10688      </intro>
10689
10690    <function id="GetCurrentThreadCpuTimerInfo" callbacksafe="safe"  impl="innative notrace" phase="start" num="134">
10691      <synopsis>Get Current Thread CPU Timer Information</synopsis>
10692      <description>
10693	Get information about the
10694        <functionlink id="GetCurrentThreadCpuTime"/> timer.
10695	The fields of the <datalink id="jvmtiTimerInfo"/> structure
10696	are filled in with details about the timer.
10697        This information is specific to the platform and the implementation of
10698        <functionlink id="GetCurrentThreadCpuTime"/> and thus
10699        does not vary by thread nor does it vary
10700        during a particular invocation of the VM.
10701        <p/>
10702        Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10703        and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10704        returned by <code>GetCurrentThreadCpuTimerInfo</code>
10705        and <functionlink id="GetThreadCpuTimerInfo"/>
10706        may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10707      </description>
10708      <origin>new</origin>
10709      <capabilities>
10710	<required id="can_get_current_thread_cpu_time">
10711	    Can get current thread CPU time.
10712	</required>
10713      </capabilities>
10714      <parameters>
10715	<param id="info_ptr">
10716	  <outptr><struct>jvmtiTimerInfo</struct></outptr>
10717	  <description>
10718	    On return, filled with information describing the time
10719	    returned by <functionlink id="GetCurrentThreadCpuTime"/>.
10720	  </description>
10721	</param>
10722      </parameters>
10723      <errors>
10724      </errors>
10725    </function>
10726
10727    <function id="GetCurrentThreadCpuTime" callbacksafe="safe" impl="innative notrace" phase="start" num="135">
10728      <synopsis>Get Current Thread CPU Time</synopsis>
10729      <description>
10730            Return the CPU time utilized by the current thread.
10731            <p/>
10732            Note that the <functionlink id="GetThreadCpuTime"/>
10733            function provides CPU time for any thread, including
10734            the current thread. <code>GetCurrentThreadCpuTime</code>
10735            exists to support platforms which cannot
10736            supply CPU time for threads other than the current
10737            thread or which have more accurate information for
10738            the current thread (see
10739            <functionlink id="GetCurrentThreadCpuTimerInfo"/> vs
10740            <functionlink id="GetThreadCpuTimerInfo"/>).
10741            On many platforms this call will be equivalent to:
10742<example>
10743  GetThreadCpuTime(env, NULL, nanos_ptr)
10744</example>
10745      </description>
10746      <origin>new</origin>
10747      <capabilities>
10748	<required id="can_get_current_thread_cpu_time">
10749	    Can get current thread CPU time.
10750            <p/>
10751	    If this capability is enabled after threads have started,
10752	    the implementation may choose any time up
10753	    to and including the time that the capability is enabled
10754	    as the point where CPU time collection starts.
10755            <p/>
10756            This capability must be potentially available on any
10757            platform where
10758            <internallink id="jvmtiCapabilities.can_get_thread_cpu_time"><code>can_get_thread_cpu_time</code></internallink>
10759            is potentially available.
10760	</required>
10761      </capabilities>
10762      <parameters>
10763        <param id="nanos_ptr">
10764	  <outptr><jlong/></outptr>
10765	  <description>
10766	    On return, points to the CPU time used by this thread
10767	    in nanoseconds.
10768            This is an unsigned value.  If tested or printed as a jlong (signed value)
10769            it may appear to be a negative number.
10770	  </description>
10771	</param>
10772      </parameters>
10773      <errors>
10774      </errors>
10775    </function>
10776
10777    <function id="GetThreadCpuTimerInfo" num="136">
10778      <synopsis>Get Thread CPU Timer Information</synopsis>
10779      <description>
10780	Get information about the
10781        <functionlink id="GetThreadCpuTime"/> timer.
10782	The fields of the <datalink id="jvmtiTimerInfo"/> structure
10783	are filled in with details about the timer.
10784        This information is specific to the platform and the implementation of
10785        <functionlink id="GetThreadCpuTime"/> and thus
10786        does not vary by thread nor does it vary
10787        during a particular invocation of the VM.
10788        <p/>
10789        Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10790        and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10791        returned by <functionlink id="GetCurrentThreadCpuTimerInfo"/>
10792        and <code>GetThreadCpuTimerInfo</code>
10793        may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10794      </description>
10795      <origin>new</origin>
10796      <capabilities>
10797	<required id="can_get_thread_cpu_time">
10798	    Can get thread CPU time.
10799	</required>
10800      </capabilities>
10801      <parameters>
10802	<param id="info_ptr">
10803	  <outptr><struct>jvmtiTimerInfo</struct></outptr>
10804	  <description>
10805	    On return, filled with information describing the time
10806	    returned by <functionlink id="GetThreadCpuTime"/>.
10807	  </description>
10808	</param>
10809      </parameters>
10810      <errors>
10811      </errors>
10812    </function>
10813
10814    <function id="GetThreadCpuTime" num="137">
10815      <synopsis>Get Thread CPU Time</synopsis>
10816      <description>
10817          Return the CPU time utilized by the specified thread.
10818          <p/>
10819	  Get information about this timer with
10820          <functionlink id="GetThreadCpuTimerInfo"/>.
10821      </description>
10822      <origin>new</origin>
10823      <capabilities>
10824	<required id="can_get_thread_cpu_time">
10825	    Can get thread CPU time.
10826            <p/>
10827	    If this capability is enabled after threads have started,
10828	    the implementation may choose any time up
10829	    to and including the time that the capability is enabled
10830	    as the point where CPU time collection starts.
10831	</required>
10832      </capabilities>
10833      <parameters>
10834	<param id="thread">
10835	  <jthread null="current"/>
10836	    <description>
10837	      The thread to query.
10838	    </description>
10839	</param>
10840        <param id="nanos_ptr">
10841	  <outptr><jlong/></outptr>
10842	  <description>
10843	    On return, points to the CPU time used by the specified thread
10844	    in nanoseconds.
10845            This is an unsigned value.  If tested or printed as a jlong (signed value)
10846            it may appear to be a negative number.
10847	  </description>
10848	</param>
10849      </parameters>
10850      <errors>
10851      </errors>
10852    </function>
10853
10854    <function id="GetTimerInfo" phase="any" callbacksafe="safe" num="138">
10855      <synopsis>Get Timer Information</synopsis>
10856      <description>
10857	Get information about the
10858        <functionlink id="GetTime"/> timer.
10859	The fields of the <datalink id="jvmtiTimerInfo"/> structure
10860	are filled in with details about the timer.
10861        This information will not change during a particular invocation of the VM.
10862      </description>
10863      <origin>new</origin>
10864      <capabilities>
10865      </capabilities>
10866      <parameters>
10867	<param id="info_ptr">
10868	  <outptr><struct>jvmtiTimerInfo</struct></outptr>
10869	  <description>
10870	    On return, filled with information describing the time
10871	    returned by <functionlink id="GetTime"/>.
10872	  </description>
10873	</param>
10874      </parameters>
10875      <errors>
10876      </errors>
10877    </function>
10878
10879    <function id="GetTime" phase="any" callbacksafe="safe" num="139">
10880      <synopsis>Get Time</synopsis>
10881      <description>
10882          Return the current value of the system timer, in nanoseconds.
10883          <p/>
10884          The value returned represents nanoseconds since some fixed but
10885          arbitrary time (perhaps in the future, so values may be
10886          negative).  This function provides nanosecond precision, but not
10887          necessarily nanosecond accuracy. No guarantees are made about
10888          how frequently values change.
10889          <p/>
10890	  Get information about this timer with
10891          <functionlink id="GetTimerInfo"/>.
10892      </description>
10893      <origin>new</origin>
10894      <capabilities>
10895      </capabilities>
10896      <parameters>
10897        <param id="nanos_ptr">
10898	  <outptr><jlong/></outptr>
10899	  <description>
10900	    On return, points to the time in nanoseconds.
10901            This is an unsigned value.  If tested or printed as a jlong (signed value)
10902            it may appear to be a negative number.
10903	  </description>
10904	</param>
10905      </parameters>
10906      <errors>
10907      </errors>
10908    </function>
10909
10910    <function id="GetAvailableProcessors" phase="any" num="144">
10911      <synopsis>Get Available Processors</synopsis>
10912      <description>
10913          Returns the number of processors available to the Java virtual machine.
10914          <p/>
10915          This value may change during a particular invocation of the virtual machine.
10916          Applications that are sensitive to the number of available processors should
10917          therefore occasionally poll this property.
10918      </description>
10919      <origin>new</origin>
10920      <capabilities>
10921      </capabilities>
10922      <parameters>
10923        <param id="processor_count_ptr">
10924	  <outptr><jint/></outptr>
10925	  <description>
10926	    On return, points to the maximum number of processors available to the
10927            virtual machine; never smaller than one.
10928	  </description>
10929	</param>
10930      </parameters>
10931      <errors>
10932      </errors>
10933    </function>
10934
10935  </category>
10936
10937
10938  <category id="classLoaderSearch" label="Class Loader Search">
10939
10940    <intro>
10941      These functions allow the agent to add to the locations that a class loader searches for a class.
10942      This is useful for installing instrumentation under the correct class loader.
10943    </intro>
10944
10945    <function id="AddToBootstrapClassLoaderSearch" jkernel="yes" phase="onload" num="149">
10946      <synopsis>Add To Bootstrap Class Loader Search</synopsis>
10947      <description>
10948          This function can be used to cause instrumentation classes to be defined by the
10949          bootstrap class loader. See <vmspec chapter="5.3.1"/>.
10950          After the bootstrap
10951	  class loader unsuccessfully searches for a class, the specified platform-dependent
10952	  search path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in
10953	  the <paramlink id="segment"/>. This function may be called multiple times to add multiple segments,
10954	  the segments will be searched in the order that this function was called.
10955	  <p/>
10956	  In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent
10957	  search path segment to be searched after the bootstrap class loader unsuccessfully searches
10958	  for a class. The segment is typically a directory or JAR file.
10959	  <p/>
10960	  In the live phase the <paramlink id="segment"/> may be used to specify any platform-dependent
10961	  path to a <externallink id="jar/jar.html">
10962	  JAR file</externallink>. The agent should take care that the JAR file does not
10963          contain any classes or resources other than those to be defined by the bootstrap
10964          class loader for the purposes of instrumentation.
10965          <p/>
10966          <vmspec/> specifies that a subsequent attempt to resolve a symbolic
10967          reference that the Java virtual machine has previously unsuccessfully attempted
10968          to resolve always fails with the same error that was thrown as a result of the
10969          initial resolution attempt. Consequently, if the JAR file contains an entry
10970          that corresponds to a class for which the Java virtual machine has
10971          unsuccessfully attempted to resolve a reference, then subsequent attempts to
10972          resolve that reference will fail with the same error as the initial attempt.
10973      </description>
10974      <origin>new</origin>
10975      <capabilities>
10976      </capabilities>
10977      <parameters>
10978        <param id="segment">
10979	  <inbuf><char/></inbuf>
10980	  <description>
10981	    The platform-dependent search path segment, encoded as a
10982	    <internallink id="mUTF">modified UTF-8</internallink> string.
10983	  </description>
10984	</param>
10985      </parameters>
10986      <errors>
10987        <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
10988          <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
10989           existing JAR file is an invalid path.
10990        </error>
10991      </errors>
10992    </function>
10993
10994    <function id="AddToSystemClassLoaderSearch" jkernel="yes" phase="onload" num="151" since="1.1">
10995      <synopsis>Add To System Class Loader Search</synopsis>
10996      <description>
10997	  This function can be used to cause instrumentation classes to be
10998	  defined by the system class loader. See <vmspec chapter="5.3.2"/>.
10999	  After the class loader unsuccessfully searches for a class, the specified platform-dependent search
11000	  path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in the
11001	  <paramlink id="segment"/>. This function may be called multiple times to add multiple segments, the
11002	  segments will be searched in the order that this function was called.
11003	  <p/>
11004	  In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent
11005	  search path segment to be searched after the system class loader unsuccessfully searches
11006	  for a class. The segment is typically a directory or JAR file.
11007	  <p/>
11008	  In the live phase the <paramlink id="segment"/> is a platform-dependent path to a
11009	  <externallink id="jar/jar.html">JAR file</externallink> to be
11010	  searched after the system class loader unsuccessfully searches for a class. The agent should
11011          take care that the JAR file does not contain any classes or resources other than those to be
11012          defined by the system class loader for the purposes of instrumentation.
11013          <p/>
11014	  In the live phase the system class loader supports adding a JAR file to be searched if
11015          the system class loader implements a method name <code>appendToClassPathForInstrumentation</code>
11016	  which takes a single parameter of type <code>java.lang.String</code>. The method is not required
11017	  to have <code>public</code> access.
11018	  <p/>
11019          <vmspec/> specifies that a subsequent attempt to resolve a symbolic
11020          reference that the Java virtual machine has previously unsuccessfully attempted
11021          to resolve always fails with the same error that was thrown as a result of the
11022          initial resolution attempt. Consequently, if the JAR file contains an entry
11023          that corresponds to a class for which the Java virtual machine has
11024          unsuccessfully attempted to resolve a reference, then subsequent attempts to
11025          resolve that reference will fail with the same error as the initial attempt.
11026      </description>
11027      <origin>new</origin>
11028      <capabilities>
11029      </capabilities>
11030      <parameters>
11031        <param id="segment">
11032          <inbuf><char/></inbuf>
11033          <description>
11034            The platform-dependent search path segment, encoded as a
11035            <internallink id="mUTF">modified UTF-8</internallink> string.
11036          </description>
11037        </param>
11038      </parameters>
11039      <errors>
11040	<error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11041          <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
11042           existing JAR file is an invalid path.
11043        </error>
11044	<error id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED">
11045	  Operation not supported by the system class loader.
11046	</error>
11047      </errors>
11048    </function>
11049
11050  </category>
11051
11052
11053  <category id="props" label="System Properties">
11054
11055    <intro>
11056      These functions get and set system properties.
11057    </intro>
11058
11059    <function id="GetSystemProperties" phase="onload" num="130">
11060      <synopsis>Get System Properties</synopsis>
11061      <description>
11062        The list of VM system property keys which may be used with
11063	<functionlink id="GetSystemProperty"/> is returned.
11064        It is strongly recommended that virtual machines provide the
11065        following property keys:
11066        <ul>
11067          <li><code>java.vm.vendor</code></li>
11068          <li><code>java.vm.version</code></li>
11069          <li><code>java.vm.name</code></li>
11070          <li><code>java.vm.info</code></li>
11071          <li><code>java.library.path</code></li>
11072          <li><code>java.class.path</code></li>
11073        </ul>
11074        Provides access to system properties defined by and used
11075        by the VM.
11076        Properties set on the command-line are included.
11077	This allows getting and setting of these properties
11078        before the VM even begins executing bytecodes.
11079	Since this is a VM view of system properties, the set of available
11080        properties will usually be different than that
11081	in <code>java.lang.System.getProperties</code>.
11082        JNI method invocation may be used to access
11083        <code>java.lang.System.getProperties</code>.
11084        <p/>
11085        The set of properties may grow during execution.
11086      </description>
11087      <origin>new</origin>
11088      <capabilities>
11089      </capabilities>
11090      <parameters>
11091        <param id="count_ptr">
11092	  <outptr><jint/></outptr>
11093	  <description>
11094	    On return, points to the number of property keys returned.
11095	  </description>
11096	</param>
11097        <param id="property_ptr">
11098	  <allocallocbuf outcount="count_ptr"><char/></allocallocbuf>
11099	  <description>
11100	    On return, points to an array of property keys, encoded as
11101	    <internallink id="mUTF">modified UTF-8</internallink> strings.
11102	  </description>
11103	</param>
11104      </parameters>
11105      <errors>
11106      </errors>
11107    </function>
11108
11109    <function id="GetSystemProperty" phase="onload" num="131">
11110      <synopsis>Get System Property</synopsis>
11111      <description>
11112        Return a VM system property value given the property key.
11113        <p/>
11114	The function <functionlink id="GetSystemProperties"/>
11115	returns the set of property keys which may be used.
11116        The properties which can be retrieved may grow during
11117	execution.
11118        <p/>
11119	Since this is a VM view of system properties, the values
11120        of properties may differ from that returned by
11121	<code>java.lang.System.getProperty(String)</code>.
11122        A typical VM might copy the values of the VM system
11123        properties into the <code>Properties</code> held by
11124	<code>java.lang.System</code> during the initialization
11125        of that class. Thereafter any changes to the VM system
11126        properties (with <functionlink id="SetSystemProperty"/>)
11127        or the <code>java.lang.System</code> system properties
11128        (with <code>java.lang.System.setProperty(String,String)</code>)
11129        would cause the values to diverge.
11130        JNI method invocation may be used to access
11131        <code>java.lang.System.getProperty(String)</code>.
11132      </description>
11133      <origin>new</origin>
11134      <capabilities>
11135      </capabilities>
11136      <parameters>
11137        <param id="property">
11138	  <inbuf><char/></inbuf>
11139	  <description>
11140	    The key of the property to retrieve, encoded as a
11141	    <internallink id="mUTF">modified UTF-8</internallink> string.
11142	  </description>
11143	</param>
11144        <param id="value_ptr">
11145	  <allocbuf><char/></allocbuf>
11146	  <description>
11147	    On return, points to the property value, encoded as a
11148	    <internallink id="mUTF">modified UTF-8</internallink> string.
11149	  </description>
11150	</param>
11151      </parameters>
11152      <errors>
11153        <error id="JVMTI_ERROR_NOT_AVAILABLE">
11154          This property is not available.
11155	  Use <functionlink id="GetSystemProperties"/> to find available properties.
11156        </error>
11157      </errors>
11158    </function>
11159
11160    <function id="SetSystemProperty" phase="onloadOnly" num="132">
11161      <synopsis>Set System Property</synopsis>
11162      <description>
11163        Set a VM system property value.
11164        <p/>
11165	The function <functionlink id="GetSystemProperties"/>
11166	returns the set of property keys, some of these may be settable.
11167        See <functionlink id="GetSystemProperty"/>.
11168      </description>
11169      <origin>new</origin>
11170      <capabilities>
11171      </capabilities>
11172      <parameters>
11173        <param id="property">
11174	  <inbuf><char/></inbuf>
11175	  <description>
11176	    The key of the property, encoded as a
11177	    <internallink id="mUTF">modified UTF-8</internallink> string.
11178	  </description>
11179	</param>
11180        <param id="value_ptr">
11181	  <inbuf>
11182	    <char/>
11183	    <nullok>
11184	      do not set the value, but return <errorlink id="JVMTI_ERROR_NOT_AVAILABLE"/>
11185	      if the property is not writeable
11186	    </nullok>
11187	  </inbuf>
11188	  <description>
11189	    The property value to set, encoded as a
11190	    <internallink id="mUTF">modified UTF-8</internallink> string.
11191	  </description>
11192	</param>
11193      </parameters>
11194      <errors>
11195        <error id="JVMTI_ERROR_NOT_AVAILABLE">
11196          This property is not available or is not writeable.
11197        </error>
11198      </errors>
11199    </function>
11200
11201  </category>
11202
11203  <category id="general" label="General">
11204
11205    <intro>
11206    </intro>
11207
11208    <function id="GetPhase" jkernel="yes" phase="any" num="133">
11209      <synopsis>Get Phase</synopsis>
11210      <description>
11211          Return the current phase of VM execution.
11212          The phases proceed in sequence:
11213          <constants id="jvmtiPhase" label="Phases of execution" kind="enum">
11214            <constant id="JVMTI_PHASE_ONLOAD" num="1">
11215              <code>OnLoad</code> phase: while in the
11216              <internallink id="onload"><code>Agent_OnLoad</code></internallink>
11217              or, for statically linked agents, the <internallink id="onload">
11218              <code>Agent_OnLoad_&lt;agent-lib-name&gt;
11219              </code></internallink> function.
11220            </constant>
11221            <constant id="JVMTI_PHASE_PRIMORDIAL" num="2">
11222              Primordial phase: between return from <code>Agent_OnLoad</code>
11223              or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> and the
11224              <code>VMStart</code> event.
11225            </constant>
11226            <constant id="JVMTI_PHASE_START" num="6">
11227              Start phase: when the <eventlink id="VMStart"><code>VMStart</code></eventlink> event
11228              is sent and until the <code>VMInit</code> event is sent.
11229            </constant>
11230            <constant id="JVMTI_PHASE_LIVE" num="4">
11231              Live phase: when the <eventlink id="VMInit"><code>VMInit</code></eventlink> event is sent
11232              and until the <eventlink id="VMDeath"></eventlink> event returns.
11233            </constant>
11234            <constant id="JVMTI_PHASE_DEAD" num="8">
11235              Dead phase: after the <eventlink id="VMDeath"></eventlink> event returns or after
11236              start-up failure.
11237            </constant>
11238          </constants>
11239          In the case of start-up failure the VM will proceed directly to the dead
11240          phase skipping intermediate phases and neither a <code>VMInit</code> nor
11241          <code>VMDeath</code> event will be sent.
11242          <p/>
11243          Most <jvmti/> functions operate only in the live phase.
11244          The following functions operate in either the <code>OnLoad</code> or live phases:
11245          <functionphaselist phase="onload"/>
11246          The following functions operate in only the <code>OnLoad</code> phase:
11247          <functionphaselist phase="onloadOnly"/>
11248          The following functions operate in the start or live phases:
11249          <functionphaselist phase="start"/>
11250          The following functions operate in any phase:
11251          <functionphaselist phase="any"/>
11252          JNI functions (except the Invocation API) must only be used in the start or live phases.
11253          <p/>
11254          Most <jvmti/> events are sent only in the live phase.
11255          The following events operate in others phases:
11256          <eventphaselist phase="start"/>
11257          <eventphaselist phase="any"/>
11258      </description>
11259      <origin>new</origin>
11260      <capabilities>
11261      </capabilities>
11262      <parameters>
11263        <param id="phase_ptr">
11264	  <outptr><enum>jvmtiPhase</enum></outptr>
11265	  <description>
11266	    On return, points to the phase.
11267	  </description>
11268	</param>
11269      </parameters>
11270      <errors>
11271      </errors>
11272    </function>
11273
11274    <function id="DisposeEnvironment" jkernel="yes" phase="any" num="127">
11275      <synopsis>Dispose Environment</synopsis>
11276      <description>
11277        Shutdown a <jvmti/> connection created with JNI <code>GetEnv</code>
11278        (see <internallink id="environments"><jvmti/> Environments</internallink>).
11279        Dispose of any resources held by the environment.
11280        <issue>
11281	    What resources are reclaimed? What is undone?
11282	    Breakpoints,watchpoints removed?
11283	</issue>
11284        Threads suspended by this environment are not resumed by this call,
11285        this must be done explicitly by the agent.
11286        Memory allocated by this environment via calls to <jvmti/> functions
11287        is not released, this can be done explicitly by the agent
11288        by calling <functionlink id="Deallocate"/>.
11289        Raw monitors created by this environment are not destroyed,
11290        this can be done explicitly by the agent
11291        by calling <functionlink id="DestroyRawMonitor"/>.
11292        The state of threads waiting on raw monitors created by this environment
11293        are not affected.
11294        <p/>
11295        Any <functionlink id="SetNativeMethodPrefix">native method
11296        prefixes</functionlink> for this environment will be unset;
11297        the agent must remove any prefixed native methods before
11298        dispose is called.
11299        <p/>
11300        Any <internallink id="capability">capabilities</internallink>
11301        held by this environment are relinquished.
11302        <p/>
11303        Events enabled by this environment will no longer be sent, however
11304        event handlers currently running will continue to run.  Caution must
11305        be exercised in the design of event handlers whose environment may
11306        be disposed and thus become invalid during their execution.
11307        <p/>
11308        This environment may not be used after this call.
11309        This call returns to the caller.
11310      </description>
11311      <origin>new</origin>
11312      <capabilities>
11313      </capabilities>
11314      <parameters>
11315      </parameters>
11316      <errors>
11317      </errors>
11318    </function>
11319
11320    <function id="SetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="148">
11321      <synopsis>Set Environment Local Storage</synopsis>
11322      <description>
11323	The VM stores a pointer value associated with each environment.
11324	This pointer value is called <i>environment-local storage</i>.
11325        This value is <code>NULL</code> unless set with this function.
11326	Agents can allocate memory in which they store environment specific
11327        information. By setting environment-local storage it can then be
11328	accessed with
11329	<functionlink id="GetEnvironmentLocalStorage"></functionlink>.
11330	<p/>
11331        Called by the agent to set the value of the <jvmti/>
11332        environment-local storage. <jvmti/> supplies to the agent a pointer-size
11333        environment-local storage that can be used to record per-environment
11334        information.
11335      </description>
11336      <origin>new</origin>
11337      <capabilities>
11338      </capabilities>
11339      <parameters>
11340        <param id="data">
11341	  <inbuf>
11342	    <void/>
11343	    <nullok>value is set to <code>NULL</code></nullok>
11344	  </inbuf>
11345	  <description>
11346	    The value to be entered into the environment-local storage.
11347	  </description>
11348	</param>
11349      </parameters>
11350      <errors>
11351      </errors>
11352    </function>
11353
11354    <function id="GetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="147">
11355      <synopsis>Get Environment Local Storage</synopsis>
11356      <description>
11357        Called by the agent to get the value of the <jvmti/> environment-local
11358        storage.
11359      </description>
11360      <origin>new</origin>
11361      <capabilities>
11362      </capabilities>
11363      <parameters>
11364        <param id="data_ptr">
11365	  <agentbuf><void/></agentbuf>
11366	  <description>
11367	    Pointer through which the value of the environment local
11368	    storage is returned.
11369	    If environment-local storage has not been set with
11370	    <functionlink id="SetEnvironmentLocalStorage"></functionlink> returned
11371	    pointer is <code>NULL</code>.
11372	  </description>
11373	</param>
11374      </parameters>
11375      <errors>
11376      </errors>
11377    </function>
11378
11379    <function id="GetVersionNumber" jkernel="yes" phase="any" num="88">
11380      <synopsis>Get Version Number</synopsis>
11381      <description>
11382        Return the <jvmti/> version via <code>version_ptr</code>.
11383        The return value is the version identifier.
11384        The version identifier includes major, minor and micro
11385        version as well as the interface type.
11386	<constants id="jvmtiVersionInterfaceTypes" label="Version Interface Types" kind="bits">
11387	  <constant id="JVMTI_VERSION_INTERFACE_JNI" num="0x00000000">
11388	    Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for JNI.
11389	  </constant>
11390	  <constant id="JVMTI_VERSION_INTERFACE_JVMTI" num="0x30000000">
11391	    Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for <jvmti/>.
11392	  </constant>
11393	</constants>
11394	<constants id="jvmtiVersionMasks" label="Version Masks" kind="bits">
11395	  <constant id="JVMTI_VERSION_MASK_INTERFACE_TYPE" num="0x70000000">
11396	    Mask to extract interface type.
11397	    The value of the version returned by this function masked with
11398	    <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> is always
11399            <code>JVMTI_VERSION_INTERFACE_JVMTI</code>
11400            since this is a <jvmti/> function.
11401	  </constant>
11402	  <constant id="JVMTI_VERSION_MASK_MAJOR" num="0x0FFF0000">
11403	    Mask to extract major version number.
11404	  </constant>
11405	  <constant id="JVMTI_VERSION_MASK_MINOR" num="0x0000FF00">
11406	    Mask to extract minor version number.
11407	  </constant>
11408	  <constant id="JVMTI_VERSION_MASK_MICRO" num="0x000000FF">
11409	    Mask to extract micro version number.
11410	  </constant>
11411	</constants>
11412	<constants id="jvmtiVersionShifts" label="Version Shifts" kind="bits">
11413	  <constant id="JVMTI_VERSION_SHIFT_MAJOR" num="16">
11414	    Shift to extract major version number.
11415	  </constant>
11416	  <constant id="JVMTI_VERSION_SHIFT_MINOR" num="8">
11417	    Shift to extract minor version number.
11418	  </constant>
11419	  <constant id="JVMTI_VERSION_SHIFT_MICRO" num="0">
11420	    Shift to extract micro version number.
11421	  </constant>
11422	</constants>
11423      </description>
11424      <origin>jvmdi</origin>
11425      <capabilities>
11426      </capabilities>
11427      <parameters>
11428        <param id="version_ptr">
11429	  <outptr><jint/></outptr>
11430	  <description>
11431	    On return, points to the <jvmti/> version.
11432	  </description>
11433	</param>
11434      </parameters>
11435      <errors>
11436      </errors>
11437    </function>
11438
11439
11440    <function id="GetErrorName" phase="any" num="128">
11441      <synopsis>Get Error Name</synopsis>
11442      <description>
11443        Return the symbolic name for an
11444          <internallink id="ErrorSection">error code</internallink>.
11445        <p/>
11446	For example
11447        <code>GetErrorName(env, JVMTI_ERROR_NONE, &amp;err_name)</code>
11448        would return in <code>err_name</code> the string
11449        <code>"JVMTI_ERROR_NONE"</code>.
11450      </description>
11451      <origin>new</origin>
11452      <capabilities>
11453      </capabilities>
11454      <parameters>
11455        <param id="error">
11456	  <enum>jvmtiError</enum>
11457	  <description>
11458	    The error code.
11459	  </description>
11460	</param>
11461        <param id="name_ptr">
11462	  <allocbuf><char/></allocbuf>
11463	  <description>
11464	    On return, points to the error name.
11465            The name is encoded as a
11466	    <internallink id="mUTF">modified UTF-8</internallink> string,
11467            but is restricted to the ASCII subset.
11468	  </description>
11469	</param>
11470      </parameters>
11471      <errors>
11472      </errors>
11473    </function>
11474
11475    <function id="SetVerboseFlag" phase="any" num="150">
11476      <synopsis>Set Verbose Flag</synopsis>
11477      <description>
11478	<constants id="jvmtiVerboseFlag" label="Verbose Flag Enumeration" kind="enum">
11479	  <constant id="JVMTI_VERBOSE_OTHER" num="0">
11480	    Verbose output other than the below.
11481	  </constant>
11482	  <constant id="JVMTI_VERBOSE_GC" num="1">
11483	    Verbose garbage collector output, like that specified with <code>-verbose:gc</code>.
11484	  </constant>
11485	  <constant id="JVMTI_VERBOSE_CLASS" num="2">
11486	    Verbose class loading output, like that specified with <code>-verbose:class</code>.
11487	  </constant>
11488	  <constant id="JVMTI_VERBOSE_JNI" num="4">
11489	    Verbose JNI output, like that specified with <code>-verbose:jni</code>.
11490	  </constant>
11491        </constants>
11492	Control verbose output.
11493	This is the output which typically is sent to <code>stderr</code>.
11494      </description>
11495      <origin>new</origin>
11496      <capabilities>
11497      </capabilities>
11498      <parameters>
11499        <param id="flag">
11500	  <enum>jvmtiVerboseFlag</enum>
11501	  <description>
11502	    Which verbose flag to set.
11503	  </description>
11504	</param>
11505        <param id="value">
11506	  <jboolean/>
11507	  <description>
11508	    New value of the flag.
11509	  </description>
11510	</param>
11511      </parameters>
11512      <errors>
11513      </errors>
11514    </function>
11515
11516
11517    <function id="GetJLocationFormat" phase="any" num="129">
11518      <synopsis>Get JLocation Format</synopsis>
11519      <description>
11520        Although the greatest functionality is achieved with location information
11521        referencing the virtual machine bytecode index, the definition of
11522        <code>jlocation</code> has intentionally been left unconstrained to allow VM
11523        implementations that do not have this information.
11524        <p/>
11525        This function describes the representation of <code>jlocation</code> used in this VM.
11526        If the returned format is <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>,
11527        <code>jlocation</code>s can
11528        be used as in indices into the array returned by
11529        <functionlink id="GetBytecodes"></functionlink>.
11530	<constants id="jvmtiJlocationFormat" label="JLocation Format Enumeration" kind="enum">
11531	  <constant id="JVMTI_JLOCATION_JVMBCI" num="1">
11532	    <code>jlocation</code> values represent virtual machine
11533	    bytecode indices--that is, offsets into the
11534	    virtual machine code for a method.
11535	  </constant>
11536	  <constant id="JVMTI_JLOCATION_MACHINEPC" num="2">
11537	    <code>jlocation</code> values represent native machine
11538	    program counter values.
11539	  </constant>
11540	  <constant id="JVMTI_JLOCATION_OTHER" num="0">
11541	    <code>jlocation</code> values have some other representation.
11542	  </constant>
11543	</constants>
11544      </description>
11545      <origin>new</origin>
11546      <capabilities>
11547      </capabilities>
11548      <parameters>
11549        <param id="format_ptr">
11550	  <outptr><enum>jvmtiJlocationFormat</enum></outptr>
11551	  <description>
11552	    On return, points to the format identifier for <code>jlocation</code> values.
11553	  </description>
11554	</param>
11555      </parameters>
11556      <errors>
11557      </errors>
11558    </function>
11559
11560  </category>
11561
11562  <category id="heap_monitoring" label="Heap Monitoring">
11563    <function id="SetHeapSamplingInterval" phase="onload" num="156" since="11">
11564      <synopsis>Set Heap Sampling Interval</synopsis>
11565      <description>
11566        Generate a <eventlink id="SampledObjectAlloc"/> event when objects are allocated.
11567	Each thread keeps a counter of bytes allocated. The event will only be generated
11568	when that counter exceeds an average of <paramlink id="sampling_interval"></paramlink>
11569	since the last sample.
11570        <p/>
11571        Setting <paramlink id="sampling_interval"></paramlink> to 0 will cause an event to be
11572        generated by each allocation supported by the system once the new interval is taken into account.
11573        <p/>
11574        Note that updating the new sampling interval might take various number of allocations
11575        to provoke internal data structure updates.  Therefore it is important to
11576        consider the sampling interval as an average. This includes the interval 0, where events
11577        might not be generated straight away for each allocation.
11578      </description>
11579      <origin>new</origin>
11580      <capabilities>
11581        <required id="can_generate_sampled_object_alloc_events"></required>
11582      </capabilities>
11583      <parameters>
11584        <param id="sampling_interval">
11585          <jint/>
11586          <description>
11587            The sampling interval in bytes. The sampler uses a statistical approach to
11588            generate an event, on average, once for every <paramlink id="sampling_interval"/> bytes of
11589	    memory allocated by a given thread.
11590            <p/>
11591            Once the new sampling interval is taken into account, 0 as a sampling interval will generate
11592            a sample for every allocation.
11593            <p/>
11594            Note: The overhead of this feature is directly correlated with the sampling interval.
11595	    A high sampling interval, such as 1024 bytes, will incur a high overhead.
11596	    A lower interval, such as 1024KB, will have a much lower overhead.  Sampling should only
11597	    be used with an understanding that it may impact performance.
11598          </description>
11599        </param>
11600      </parameters>
11601      <errors>
11602        <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11603          <paramlink id="sampling_interval"></paramlink> is less than zero.
11604        </error>
11605      </errors>
11606    </function>
11607  </category>
11608
11609</functionsection>
11610
11611<errorsection label="Error Reference">
11612  <intro>
11613    Every <jvmti/> function returns a <b><code>jvmtiError</code></b> error code.
11614    <p/>
11615    It is the responsibility of the agent to call <jvmti/> functions with
11616    valid parameters and in the proper context (calling thread is attached,
11617    phase is correct, etc.).
11618    Detecting some error conditions may be difficult, inefficient, or
11619    impossible for an implementation.
11620    The errors listed in
11621    <internallink id="reqerrors">Function Specific Required Errors</internallink>
11622    must be detected by the implementation.
11623    All other errors represent the recommended response to the error
11624    condition.
11625  </intro>
11626
11627  <errorcategory id="universal-error" label="Universal Errors">
11628    <intro>
11629      The following errors may be returned by any function
11630    </intro>
11631
11632    <errorid id="JVMTI_ERROR_NONE" num="0">
11633      No error has occurred.  This is the error code that is returned
11634      on successful completion of the function.
11635    </errorid>
11636    <errorid id="JVMTI_ERROR_NULL_POINTER" num="100">
11637      Pointer is unexpectedly <code>NULL</code>.
11638    </errorid>
11639    <errorid id="JVMTI_ERROR_OUT_OF_MEMORY" num="110">
11640      The function attempted to allocate memory and no more memory was
11641      available for allocation.
11642    </errorid>
11643    <errorid id="JVMTI_ERROR_ACCESS_DENIED" num="111">
11644      The desired functionality has not been enabled in this virtual machine.
11645    </errorid>
11646    <errorid id="JVMTI_ERROR_UNATTACHED_THREAD" num="115">
11647      The thread being used to call this function is not attached
11648      to the virtual machine.  Calls must be made from attached threads.
11649      See <code>AttachCurrentThread</code> in the JNI invocation API.
11650    </errorid>
11651    <errorid id="JVMTI_ERROR_INVALID_ENVIRONMENT" num="116">
11652      The <jvmti/> environment provided is no longer connected or is
11653      not an environment.
11654    </errorid>
11655    <errorid id="JVMTI_ERROR_WRONG_PHASE" num="112">
11656      The desired functionality is not available in the current
11657        <functionlink id="GetPhase">phase</functionlink>.
11658      Always returned if the virtual machine has completed running.
11659    </errorid>
11660    <errorid id="JVMTI_ERROR_INTERNAL" num="113">
11661      An unexpected internal error has occurred.
11662    </errorid>
11663  </errorcategory>
11664
11665  <errorcategory id="reqerrors" label="Function Specific Required Errors">
11666    <intro>
11667      The following errors are returned by some <jvmti/> functions and must
11668      be returned by the implementation when the condition occurs.
11669    </intro>
11670
11671    <errorid id="JVMTI_ERROR_INVALID_PRIORITY" num="12">
11672      Invalid priority.
11673    </errorid>
11674    <errorid id="JVMTI_ERROR_THREAD_NOT_SUSPENDED" num="13">
11675      Thread was not suspended.
11676    </errorid>
11677    <errorid id="JVMTI_ERROR_THREAD_SUSPENDED" num="14">
11678      Thread already suspended.
11679    </errorid>
11680    <errorid id="JVMTI_ERROR_THREAD_NOT_ALIVE" num="15">
11681      This operation requires the thread to be alive--that is,
11682      it must be started and not yet have died.
11683    </errorid>
11684    <errorid id="JVMTI_ERROR_CLASS_NOT_PREPARED" num="22">
11685      The class has been loaded but not yet prepared.
11686    </errorid>
11687    <errorid id="JVMTI_ERROR_NO_MORE_FRAMES" num="31">
11688      There are no Java programming language or JNI stack frames at the specified depth.
11689    </errorid>
11690    <errorid id="JVMTI_ERROR_OPAQUE_FRAME" num="32">
11691      Information about the frame is not available (e.g. for native frames).
11692    </errorid>
11693    <errorid id="JVMTI_ERROR_DUPLICATE" num="40">
11694      Item already set.
11695    </errorid>
11696    <errorid id="JVMTI_ERROR_NOT_FOUND" num="41">
11697      Desired element (e.g. field or breakpoint) not found
11698    </errorid>
11699    <errorid id="JVMTI_ERROR_NOT_MONITOR_OWNER" num="51">
11700      This thread doesn't own the raw monitor.
11701    </errorid>
11702    <errorid id="JVMTI_ERROR_INTERRUPT" num="52">
11703      The call has been interrupted before completion.
11704    </errorid>
11705    <errorid id="JVMTI_ERROR_UNMODIFIABLE_CLASS" num="79">
11706      The class cannot be modified.
11707    </errorid>
11708    <errorid id="JVMTI_ERROR_UNMODIFIABLE_MODULE" num="80">
11709      The module cannot be modified.
11710    </errorid>
11711    <errorid id="JVMTI_ERROR_NOT_AVAILABLE" num="98">
11712      The functionality is not available in this virtual machine.
11713    </errorid>
11714    <errorid id="JVMTI_ERROR_ABSENT_INFORMATION" num="101">
11715      The requested information is not available.
11716    </errorid>
11717    <errorid id="JVMTI_ERROR_INVALID_EVENT_TYPE" num="102">
11718      The specified event type ID is not recognized.
11719    </errorid>
11720    <errorid id="JVMTI_ERROR_NATIVE_METHOD" num="104">
11721      The requested information is not available for native method.
11722    </errorid>
11723    <errorid id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED" num="106">
11724      The class loader does not support this operation.
11725    </errorid>
11726  </errorcategory>
11727
11728  <errorcategory id="function-specific-errors" label="Function Specific Agent Errors">
11729    <intro>
11730      The following errors are returned by some <jvmti/> functions.
11731      They are returned in the event of invalid parameters passed by the
11732      agent or usage in an invalid context.
11733      An implementation is not required to detect these errors.
11734    </intro>
11735
11736    <errorid id="JVMTI_ERROR_INVALID_THREAD" num="10">
11737      The passed thread is not a valid thread.
11738    </errorid>
11739    <errorid id="JVMTI_ERROR_INVALID_FIELDID" num="25">
11740      Invalid field.
11741    </errorid>
11742    <errorid id="JVMTI_ERROR_INVALID_MODULE" num="26">
11743      Invalid module.
11744    </errorid>
11745    <errorid id="JVMTI_ERROR_INVALID_METHODID" num="23">
11746      Invalid method.
11747    </errorid>
11748    <errorid id="JVMTI_ERROR_INVALID_LOCATION" num="24">
11749      Invalid location.
11750    </errorid>
11751    <errorid id="JVMTI_ERROR_INVALID_OBJECT" num="20">
11752      Invalid object.
11753    </errorid>
11754    <errorid id="JVMTI_ERROR_INVALID_CLASS" num="21">
11755      Invalid class.
11756    </errorid>
11757    <errorid id="JVMTI_ERROR_TYPE_MISMATCH" num="34">
11758      The variable is not an appropriate type for the function used.
11759    </errorid>
11760    <errorid id="JVMTI_ERROR_INVALID_SLOT" num="35">
11761      Invalid slot.
11762    </errorid>
11763    <errorid id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY" num="99">
11764      The capability being used is false in this environment.
11765    </errorid>
11766    <errorid id="JVMTI_ERROR_INVALID_THREAD_GROUP" num="11">
11767      Thread group invalid.
11768    </errorid>
11769    <errorid id="JVMTI_ERROR_INVALID_MONITOR" num="50">
11770      Invalid raw monitor.
11771    </errorid>
11772    <errorid id="JVMTI_ERROR_ILLEGAL_ARGUMENT" num="103">
11773      Illegal argument.
11774    </errorid>
11775    <errorid id="JVMTI_ERROR_INVALID_TYPESTATE" num="65">
11776      The state of the thread has been modified, and is now inconsistent.
11777    </errorid>
11778    <errorid id="JVMTI_ERROR_UNSUPPORTED_VERSION" num="68">
11779      A new class file has a version number not supported by this VM.
11780    </errorid>
11781    <errorid id="JVMTI_ERROR_INVALID_CLASS_FORMAT" num="60">
11782      A new class file is malformed (the VM would return a <code>ClassFormatError</code>).
11783    </errorid>
11784    <errorid id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION" num="61">
11785      The new class file definitions would lead to a circular
11786      definition (the VM would return a <code>ClassCircularityError</code>).
11787    </errorid>
11788    <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED" num="63">
11789      A new class file would require adding a method.
11790    </errorid>
11791    <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED" num="64">
11792      A new class version changes a field.
11793    </errorid>
11794    <errorid id="JVMTI_ERROR_FAILS_VERIFICATION" num="62">
11795      The class bytes fail verification.
11796    </errorid>
11797    <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED" num="66">
11798      A direct superclass is different for the new class
11799      version, or the set of directly implemented
11800      interfaces is different.
11801    </errorid>
11802    <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED" num="67">
11803      A new class version does not declare a method
11804      declared in the old class version.
11805    </errorid>
11806    <errorid id="JVMTI_ERROR_NAMES_DONT_MATCH" num="69">
11807      The class name defined in the new class file is
11808      different from the name in the old class object.
11809    </errorid>
11810    <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED" num="70">
11811      A new class version has different modifiers.
11812    </errorid>
11813    <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED" num="71">
11814      A method in the new class version has different modifiers
11815      than its counterpart in the old class version.
11816    </errorid>
11817    <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED" num="72">
11818      A new class version has unsupported differences in class attributes.
11819    </errorid>
11820  </errorcategory>
11821</errorsection>
11822
11823<eventsection label="Events">
11824  <intro label="Handling Events" id="eventIntro">
11825    Agents can be informed of many events that occur in application
11826    programs.
11827    <p/>
11828    To handle events, designate a set of callback functions with
11829    <functionlink id="SetEventCallbacks"></functionlink>.
11830    For each event the corresponding callback function will be
11831    called.
11832    Arguments to the callback function provide additional
11833    information about the event.
11834    <p/>
11835    The callback function is usually called from within an application
11836    thread. The <jvmti/> implementation does not
11837    queue events in any way. This means
11838    that event callback functions must be written
11839    carefully. Here are some general guidelines. See
11840    the individual event descriptions for further
11841    suggestions.
11842    <p/>
11843    <ul>
11844      <li>Any exception thrown during the execution of an event callback can
11845	overwrite any current pending exception in the current application thread.
11846	Care must be taken to preserve a pending exception
11847	when an event callback makes a JNI call that might generate an exception.
11848      </li>
11849      <li>Event callback functions must be re-entrant. The <jvmti/> implementation does
11850	not queue events. If an agent needs to process events one at a time, it
11851	can use a raw monitor inside the
11852	event callback functions to serialize event processing.
11853      </li>
11854      <li>Event callback functions that execute JNI's FindClass function to load
11855        classes need to note that FindClass locates the class loader associated
11856        with the current native method. For the purposes of class loading, an
11857        event callback that includes a JNI environment as a parameter to the
11858        callback will treated as if it is a native call, where the native method
11859        is in the class of the event thread's current frame.
11860      </li>
11861    </ul>
11862    <p/>
11863    Some <jvmti/> events identify objects with JNI references.
11864    All references
11865    in <jvmti/> events are JNI local references and will become invalid
11866    after the event callback returns.
11867    Unless stated otherwise, memory referenced by pointers sent in event
11868    callbacks may not be referenced after the event callback returns.
11869    <p/>
11870    Except where stated otherwise, events are delivered on the thread
11871    that caused the event.
11872    Events are sent at the time they occur.
11873    The specification for each event includes the set of
11874    <functionlink id="GetPhase">phases</functionlink> in which it can be sent;
11875    if an event triggering activity occurs during another phase, no event
11876    is sent.
11877    <p/>
11878    A thread that generates an event does not change its execution status
11879    (for example, the event does not cause the thread to be suspended).
11880    If an agent wishes the event to result in suspension, then the agent
11881    is responsible for explicitly suspending the thread with
11882    <functionlink id="SuspendThread"></functionlink>.
11883    <p/>
11884    If an event is enabled in multiple environments, the event will be sent
11885    to each agent in the order that the environments were created.
11886  </intro>
11887
11888  <intro label="Enabling Events" id="enablingevents">
11889    All events are initially disabled.  In order to receive any
11890    event:
11891      <ul>
11892	<li>
11893	  If the event requires a capability, that capability must
11894	  be added with
11895	  <functionlink id="AddCapabilities"></functionlink>.
11896	</li>
11897	<li>
11898	  A callback for the event must be set with
11899	  <functionlink id="SetEventCallbacks"></functionlink>.
11900	</li>
11901	<li>
11902	  The event must be enabled with
11903	  <functionlink id="SetEventNotificationMode"></functionlink>.
11904	</li>
11905      </ul>
11906  </intro>
11907
11908  <intro label="Multiple Co-located Events" id="eventorder">
11909    In many situations it is possible for multiple events to occur
11910    at the same location in one thread. When this happens, all the events
11911    are reported through the event callbacks in the order specified in this section.
11912    <p/>
11913    If the current location is at the entry point of a method, the
11914    <eventlink id="MethodEntry"></eventlink> event is reported before
11915    any other event at the current location in the same thread.
11916    <p/>
11917    If an exception catch has been detected at the current location,
11918    either because it is the beginning of a catch clause or a native method
11919    that cleared a pending exception has returned, the
11920    <code>exceptionCatch</code> event is reported before
11921    any other event at the current location in the same thread.
11922    <p/>
11923    If a <code>singleStep</code> event or
11924    <code>breakpoint</code> event is triggered at the
11925    current location, the event is defined to occur
11926    immediately before the code at the current location is executed.
11927    These events are reported before any events which are triggered
11928    by the execution of code at the current location in the same
11929    thread (specifically:
11930    <code>exception</code>,
11931    <code>fieldAccess</code>, and
11932    <code>fieldModification</code>).
11933    If both a step and breakpoint event are triggered for the same thread and
11934    location, the step event is reported before the breakpoint event.
11935    <p/>
11936    If the current location is the exit point of a method (that is, the last
11937    location before returning to the caller), the
11938    <eventlink id="MethodExit"></eventlink> event and
11939    the <eventlink id="FramePop"></eventlink> event (if requested)
11940    are reported after all other events at the current location in the same
11941    thread. There is no specified ordering of these two events
11942    with respect to each other.
11943    <p/>
11944    Co-located events can be triggered during the processing of some other
11945    event by the agent at the same location in the same thread.
11946    If such an event, of type <i>y</i>, is triggered during the processing of
11947    an event of type <i>x</i>, and if <i>x</i>
11948    precedes <i>y</i> in the ordering specified above, the co-located event
11949    <i>y</i> is reported for the current thread and location. If <i>x</i> does not precede
11950    <i>y</i>, <i>y</i> is not reported for the current thread and location.
11951    For example, if a breakpoint is set at the current location
11952    during the processing of <eventlink id="SingleStep"></eventlink>,
11953    that breakpoint will be reported before the thread moves off the current
11954    location.
11955    <p/>The following events are never considered to be co-located with
11956    other events.
11957    <ul>
11958      <li><eventlink id="VMStart"></eventlink></li>
11959      <li><eventlink id="VMInit"></eventlink></li>
11960      <li><eventlink id="VMDeath"></eventlink></li>
11961      <li><eventlink id="ThreadStart"></eventlink></li>
11962      <li><eventlink id="ThreadEnd"></eventlink></li>
11963      <li><eventlink id="ClassLoad"></eventlink></li>
11964      <li><eventlink id="ClassPrepare"></eventlink></li>
11965    </ul>
11966  </intro>
11967
11968  <intro label="Event Callbacks" id="jvmtiEventCallbacks">
11969      The event callback structure below is used to specify the handler function
11970      for events.  It is set with the
11971      <functionlink id="SetEventCallbacks"></functionlink> function.
11972  </intro>
11973
11974  <event label="Single Step"
11975	 id="SingleStep" const="JVMTI_EVENT_SINGLE_STEP" filtered="thread" num="60">
11976    <description>
11977      Single step events allow the agent to trace thread execution
11978      at the finest granularity allowed by the VM. A single step event is
11979      generated whenever a thread reaches a new location.
11980      Typically, single step events represent the completion of one VM
11981      instruction as defined in <vmspec/>. However, some implementations
11982      may define locations differently. In any case the
11983      <code>method</code> and <code>location</code>
11984      parameters  uniquely identify the current location and allow
11985      the mapping to source file and line number when that information is
11986      available.
11987      <p/>
11988      No single step events are generated from within native methods.
11989    </description>
11990    <origin>jvmdi</origin>
11991    <capabilities>
11992      <required id="can_generate_single_step_events"></required>
11993    </capabilities>
11994    <parameters>
11995      <param id="jni_env">
11996        <outptr>
11997          <struct>JNIEnv</struct>
11998        </outptr>
11999          <description>
12000            The JNI environment of the event (current) thread
12001          </description>
12002      </param>
12003      <param id="thread">
12004	<jthread/>
12005	  <description>
12006	    Thread about to execution a new instruction
12007	  </description>
12008      </param>
12009      <param id="klass">
12010	<jclass method="method"/>
12011	  <description>
12012	    Class of the method about to execute a new instruction
12013	  </description>
12014      </param>
12015      <param id="method">
12016	<jmethodID class="klass"/>
12017	  <description>
12018	    Method about to execute a new instruction
12019	  </description>
12020      </param>
12021      <param id="location">
12022	<jlocation/>
12023	<description>
12024	  Location of the new instruction
12025	</description>
12026      </param>
12027    </parameters>
12028  </event>
12029
12030  <event label="Breakpoint"
12031	 id="Breakpoint" const="JVMTI_EVENT_BREAKPOINT" filtered="thread" num="62">
12032    <description>
12033      Breakpoint events are generated whenever a thread reaches a location
12034      designated as a breakpoint with <functionlink id="SetBreakpoint"></functionlink>.
12035      The <code>method</code> and <code>location</code>
12036      parameters uniquely identify the current location and allow
12037      the mapping to source file and line number when that information is
12038      available.
12039    </description>
12040    <origin>jvmdi</origin>
12041    <capabilities>
12042      <required id="can_generate_breakpoint_events"></required>
12043    </capabilities>
12044    <parameters>
12045      <param id="jni_env">
12046        <outptr>
12047          <struct>JNIEnv</struct>
12048        </outptr>
12049          <description>
12050            The JNI environment of the event (current) thread.
12051          </description>
12052      </param>
12053      <param id="thread">
12054	<jthread/>
12055	  <description>
12056	    Thread that hit the breakpoint
12057	  </description>
12058      </param>
12059      <param id="klass">
12060	<jclass method="method"/>
12061	  <description>
12062	    Class of the method that hit the breakpoint
12063	  </description>
12064      </param>
12065      <param id="method">
12066	<jmethodID class="klass"/>
12067	  <description>
12068	    Method that hit the breakpoint
12069	  </description>
12070      </param>
12071      <param id="location">
12072	<jlocation/>
12073	<description>
12074	  location of the breakpoint
12075	</description>
12076      </param>
12077    </parameters>
12078  </event>
12079
12080  <event label="Field Access"
12081	 id="FieldAccess" const="JVMTI_EVENT_FIELD_ACCESS" filtered="thread" num="63">
12082    <description>
12083      Field access events are generated whenever a thread accesses
12084      a field that was designated as a watchpoint
12085      with <functionlink id="SetFieldAccessWatch"></functionlink>.
12086      The <code>method</code> and <code>location</code>
12087      parameters uniquely identify the current location and allow
12088      the mapping to source file and line number when that information is
12089      available.
12090    </description>
12091    <origin>jvmdi</origin>
12092    <capabilities>
12093      <required id="can_generate_field_access_events"></required>
12094    </capabilities>
12095    <parameters>
12096      <param id="jni_env">
12097        <outptr>
12098          <struct>JNIEnv</struct>
12099        </outptr>
12100          <description>
12101            The JNI environment of the event (current) thread
12102          </description>
12103      </param>
12104      <param id="thread">
12105	<jthread/>
12106	  <description>
12107	    Thread accessing the field
12108	  </description>
12109      </param>
12110      <param id="klass">
12111	<jclass method="method"/>
12112	  <description>
12113	    Class of the method where the access is occurring
12114	  </description>
12115      </param>
12116      <param id="method">
12117	<jmethodID class="klass"/>
12118	  <description>
12119	    Method where the access is occurring
12120	  </description>
12121      </param>
12122      <param id="location">
12123	<jlocation/>
12124	<description>
12125	  Location where the access is occurring
12126	</description>
12127      </param>
12128      <param id="field_klass">
12129	<jclass field="field"/>
12130	  <description>
12131	    Class of the field being accessed
12132	  </description>
12133      </param>
12134      <param id="object">
12135	<jobject/>
12136	  <description>
12137	    Object with the field being accessed if the field is an
12138	    instance field; <code>NULL</code> otherwise
12139	  </description>
12140      </param>
12141      <param id="field">
12142	<jfieldID class="field_klass"/>
12143	  <description>
12144	    Field being accessed
12145	  </description>
12146      </param>
12147    </parameters>
12148  </event>
12149
12150  <event label="Field Modification"
12151	 id="FieldModification" const="JVMTI_EVENT_FIELD_MODIFICATION" filtered="thread" num="64">
12152    <description>
12153      Field modification events are generated whenever a thread modifies
12154      a field that was designated as a watchpoint
12155      with <functionlink id="SetFieldModificationWatch"></functionlink>.
12156      The <code>method</code> and <code>location</code>
12157      parameters uniquely identify the current location and allow
12158      the mapping to source file and line number when that information is
12159      available.
12160    </description>
12161    <origin>jvmdi</origin>
12162    <capabilities>
12163      <required id="can_generate_field_modification_events"></required>
12164    </capabilities>
12165    <parameters>
12166      <param id="jni_env">
12167        <outptr>
12168          <struct>JNIEnv</struct>
12169        </outptr>
12170          <description>
12171            The JNI environment of the event (current) thread
12172          </description>
12173      </param>
12174      <param id="thread">
12175	<jthread/>
12176	  <description>
12177	    Thread modifying the field
12178	  </description>
12179      </param>
12180      <param id="klass">
12181	<jclass method="method"/>
12182	  <description>
12183	    Class of the method where the modification is occurring
12184	  </description>
12185      </param>
12186      <param id="method">
12187	<jmethodID class="klass"/>
12188	  <description>
12189	    Method where the modification is occurring
12190	  </description>
12191      </param>
12192      <param id="location">
12193	<jlocation/>
12194	<description>
12195	  Location where the modification is occurring
12196	</description>
12197      </param>
12198      <param id="field_klass">
12199	<jclass field="field"/>
12200	  <description>
12201	    Class of the field being modified
12202	  </description>
12203      </param>
12204      <param id="object">
12205	<jobject/>
12206	  <description>
12207	    Object with the field being modified if the field is an
12208	    instance field; <code>NULL</code> otherwise
12209	  </description>
12210      </param>
12211      <param id="field">
12212	<jfieldID class="field_klass"/>
12213	  <description>
12214	    Field being modified
12215	  </description>
12216      </param>
12217      <param id="signature_type">
12218	<char/>
12219	<description>
12220	  Signature type of the new value
12221	</description>
12222      </param>
12223      <param id="new_value">
12224	<jvalue/>
12225	<description>
12226	  The new value
12227	</description>
12228      </param>
12229    </parameters>
12230  </event>
12231
12232  <event label="Frame Pop"
12233	 id="FramePop" const="JVMTI_EVENT_FRAME_POP" filtered="thread" num="61">
12234    <description>
12235      Frame pop events are generated upon exit from a single method
12236      in a single frame as specified
12237      in a call to <functionlink id="NotifyFramePop"></functionlink>.
12238      This is true whether termination is caused by
12239      executing its return instruction
12240      or by throwing an exception to its caller
12241      (see <paramlink id="was_popped_by_exception"></paramlink>).
12242      However, frame pops caused by the <functionlink id="PopFrame"/>
12243      function are not reported.
12244      <p/>
12245      The location reported by <functionlink id="GetFrameLocation"></functionlink>
12246      identifies the executable location in the returning method,
12247      immediately prior to the return.
12248    </description>
12249    <origin>jvmdi</origin>
12250    <capabilities>
12251      <required id="can_generate_frame_pop_events"></required>
12252    </capabilities>
12253    <parameters>
12254      <param id="jni_env">
12255        <outptr>
12256          <struct>JNIEnv</struct>
12257        </outptr>
12258          <description>
12259            The JNI environment of the event (current) thread
12260          </description>
12261      </param>
12262      <param id="thread">
12263	<jthread/>
12264	  <description>
12265	    Thread that is popping the frame
12266	  </description>
12267      </param>
12268      <param id="klass">
12269	<jclass method="method"/>
12270	  <description>
12271	    Class of the method being popped
12272	  </description>
12273      </param>
12274      <param id="method">
12275	<jmethodID class="klass"/>
12276	  <description>
12277	    Method being popped
12278	  </description>
12279      </param>
12280      <param id="was_popped_by_exception">
12281	<jboolean/>
12282	<description>
12283	  True if frame was popped by a thrown exception.
12284	  False if method exited through its return instruction.
12285	</description>
12286      </param>
12287    </parameters>
12288  </event>
12289
12290  <event label="Method Entry"
12291	 id="MethodEntry" const="JVMTI_EVENT_METHOD_ENTRY" filtered="thread" num="65">
12292    <description>
12293      Method entry events are generated upon entry of Java
12294      programming language methods (including native methods).
12295      <p/>
12296      The location reported by <functionlink id="GetFrameLocation"></functionlink>
12297      identifies the initial executable location in
12298      the method.
12299      <p/>
12300      Enabling method
12301      entry or exit events will significantly degrade performance on many platforms and is thus
12302      not advised for performance critical usage (such as profiling).
12303      <internallink id="bci">Bytecode instrumentation</internallink> should be
12304      used in these cases.
12305    </description>
12306    <origin>jvmdi</origin>
12307    <capabilities>
12308      <required id="can_generate_method_entry_events"></required>
12309    </capabilities>
12310    <parameters>
12311      <param id="jni_env">
12312        <outptr>
12313          <struct>JNIEnv</struct>
12314        </outptr>
12315          <description>
12316            The JNI environment of the event (current) thread
12317          </description>
12318      </param>
12319      <param id="thread">
12320	<jthread/>
12321	  <description>
12322	    Thread entering the method
12323	  </description>
12324      </param>
12325      <param id="klass">
12326	<jclass method="method"/>
12327	  <description>
12328	    Class of the method being entered
12329	  </description>
12330      </param>
12331      <param id="method">
12332	<jmethodID class="klass"/>
12333	  <description>
12334	    Method being entered
12335	  </description>
12336      </param>
12337    </parameters>
12338  </event>
12339
12340  <event label="Method Exit"
12341	 id="MethodExit" const="JVMTI_EVENT_METHOD_EXIT" filtered="thread" num="66">
12342    <description>
12343      Method exit events are generated upon exit from Java
12344      programming language methods (including native methods).
12345      This is true whether termination is caused by
12346      executing its return instruction
12347      or by throwing an exception to its caller
12348      (see <paramlink id="was_popped_by_exception"></paramlink>).
12349      <p/>
12350      The <code>method</code> field uniquely identifies the
12351      method being entered or exited. The <code>frame</code> field provides
12352      access to the stack frame for the method.
12353      <p/>
12354      The location reported by <functionlink id="GetFrameLocation"></functionlink>
12355      identifies the executable location in the returning method
12356      immediately prior to the return.
12357      <p/>
12358        Enabling method
12359	entry or exit events will significantly degrade performance on many platforms and is thus
12360	not advised for performance critical usage (such as profiling).
12361        <internallink id="bci">Bytecode instrumentation</internallink> should be
12362        used in these cases.
12363    </description>
12364    <origin>jvmdi</origin>
12365    <capabilities>
12366      <required id="can_generate_method_exit_events"></required>
12367    </capabilities>
12368    <parameters>
12369      <param id="jni_env">
12370        <outptr>
12371          <struct>JNIEnv</struct>
12372        </outptr>
12373          <description>
12374            The JNI environment of the event (current) thread
12375          </description>
12376      </param>
12377      <param id="thread">
12378	<jthread/>
12379	  <description>
12380	    Thread exiting the method
12381	  </description>
12382      </param>
12383      <param id="klass">
12384	<jclass method="method"/>
12385	  <description>
12386	    Class of the method being exited
12387	  </description>
12388      </param>
12389      <param id="method">
12390	<jmethodID class="klass"/>
12391	  <description>
12392	    Method being exited
12393	  </description>
12394      </param>
12395      <param id="was_popped_by_exception">
12396	<jboolean/>
12397	<description>
12398	  True if frame was popped by a thrown exception.
12399	  False if method exited through its return instruction.
12400	</description>
12401      </param>
12402      <param id="return_value">
12403	<jvalue/>
12404	<description>
12405	  The return value of the method being exited.
12406	  Undefined and should not be used if
12407	  <paramlink id="was_popped_by_exception"></paramlink>
12408	  is true.
12409	</description>
12410      </param>
12411    </parameters>
12412  </event>
12413
12414  <event label="Native Method Bind" phase="any"
12415	 id="NativeMethodBind" const="JVMTI_EVENT_NATIVE_METHOD_BIND" num="67">
12416    <description>
12417      A Native Method Bind event is sent when a VM binds a
12418      Java programming language native method
12419      to the address of a function that implements the native method.
12420      This will occur when the native method is called for the first time
12421      and also occurs when the JNI function <code>RegisterNatives</code> is called.
12422      This event allows the bind to be redirected to an agent-specified
12423      proxy function.
12424      This event is not sent when the native method is unbound.
12425      Typically, this proxy function will need to be specific to a
12426      particular method or, to handle the general case, automatically
12427      generated assembly code, since after instrumentation code is
12428      executed the function at the original binding
12429      address will usually be invoked.
12430      The original binding can be restored or the redirection changed
12431      by use of the JNI function <code>RegisterNatives</code>.
12432      Some events may be sent during the primordial phase, JNI and
12433      most of <jvmti/> cannot be used at this time but the method and
12434      address can be saved for use later.
12435    </description>
12436    <origin>new</origin>
12437    <capabilities>
12438      <required id="can_generate_native_method_bind_events"></required>
12439    </capabilities>
12440    <parameters>
12441      <param id="jni_env">
12442        <outptr>
12443          <struct>JNIEnv</struct>
12444        </outptr>
12445          <description>
12446            The JNI environment of the event (current) thread
12447	    Will be <code>NULL</code> if sent during the primordial
12448            <functionlink id="GetPhase">phase</functionlink>.
12449          </description>
12450      </param>
12451      <param id="thread">
12452	<jthread/>
12453	  <description>
12454	    Thread requesting the bind
12455	  </description>
12456      </param>
12457      <param id="klass">
12458	<jclass method="method"/>
12459	  <description>
12460	    Class of the method being bound
12461	  </description>
12462      </param>
12463      <param id="method">
12464	<jmethodID class="klass"/>
12465	  <description>
12466	    Native method being bound
12467	  </description>
12468      </param>
12469      <param id="address">
12470	<outptr><void/></outptr>
12471	<description>
12472	  The address the VM is about to bind to--that is, the
12473	  address of the implementation of the native method
12474	</description>
12475      </param>
12476      <param id="new_address_ptr">
12477        <agentbuf><void/></agentbuf>
12478	<description>
12479	  if the referenced address is changed (that is, if
12480	  <code>*new_address_ptr</code> is set), the binding
12481	  will instead be made to the supplied address.
12482	</description>
12483      </param>
12484    </parameters>
12485  </event>
12486
12487  <event label="Exception"
12488	 id="Exception" const="JVMTI_EVENT_EXCEPTION" filtered="thread" num="58">
12489    <description>
12490      Exception events are generated whenever an exception is first detected
12491      in a Java programming language method.
12492      Where "exception" means any <code>java.lang.Throwable</code>.
12493      The exception may have been thrown by a Java programming language or native
12494      method, but in the case of native methods, the event is not generated
12495      until the exception is first seen by a Java programming language method. If an exception is
12496      set and cleared in a native method (and thus is never visible to Java programming language code),
12497      no exception event is generated.
12498      <p/>
12499      The <code>method</code> and <code>location</code>
12500      parameters  uniquely identify the current location
12501      (where the exception was detected) and allow
12502      the mapping to source file and line number when that information is
12503      available. The <code>exception</code> field identifies the thrown
12504      exception object. The <code>catch_method</code>
12505      and <code>catch_location</code> identify the location of the catch clause,
12506      if any, that handles the thrown exception. If there is no such catch clause,
12507      each field is set to 0. There is no guarantee that the thread will ever
12508      reach this catch clause. If there are native methods on the call stack
12509      between the throw location and the catch clause, the exception may
12510      be reset by one of those native methods.
12511      Similarly, exceptions that are reported as uncaught (<code>catch_klass</code>
12512      et al. set to 0) may in fact be caught by native code.
12513      Agents can check for these occurrences by monitoring
12514      <eventlink id="ExceptionCatch"></eventlink> events.
12515      Note that finally clauses are implemented as catch and re-throw. Therefore they
12516      will be reported in the catch location.
12517    </description>
12518    <origin>jvmdi</origin>
12519    <capabilities>
12520      <required id="can_generate_exception_events"></required>
12521    </capabilities>
12522    <parameters>
12523      <param id="jni_env">
12524        <outptr>
12525          <struct>JNIEnv</struct>
12526        </outptr>
12527          <description>
12528            The JNI environment of the event (current) thread
12529          </description>
12530      </param>
12531      <param id="thread">
12532	<jthread/>
12533	  <description>
12534	    Thread generating the exception
12535	  </description>
12536      </param>
12537      <param id="klass">
12538	<jclass method="method"/>
12539	  <description>
12540	    Class generating the exception
12541	  </description>
12542      </param>
12543      <param id="method">
12544	<jmethodID class="klass"/>
12545	  <description>
12546	    Method generating the exception
12547	  </description>
12548      </param>
12549      <param id="location">
12550	<jlocation/>
12551	<description>
12552	  Location where exception occurred
12553	</description>
12554      </param>
12555      <param id="exception">
12556	<jobject/>
12557	  <description>
12558	    The exception being thrown
12559	  </description>
12560      </param>
12561      <param id="catch_klass">
12562	<jclass method="catch_method"/>
12563	  <description>
12564	    Class that will catch the exception, or <code>NULL</code> if no known catch
12565	  </description>
12566      </param>
12567      <param id="catch_method">
12568	<jmethodID class="catch_klass"/>
12569	  <description>
12570	    Method that will catch the exception, or <code>NULL</code> if no known catch
12571	  </description>
12572      </param>
12573      <param id="catch_location">
12574	<jlocation/>
12575	<description>
12576	  location which will catch the exception or zero if no known catch
12577	</description>
12578      </param>
12579    </parameters>
12580  </event>
12581
12582  <event label="Exception Catch"
12583	 id="ExceptionCatch" const="JVMTI_EVENT_EXCEPTION_CATCH" filtered="thread" num="59">
12584    <description>
12585      Exception catch events are generated whenever a thrown exception is caught.
12586      Where "exception" means any <code>java.lang.Throwable</code>.
12587      If the exception is caught in a Java programming language method, the event is generated
12588      when the catch clause is reached. If the exception is caught in a native
12589      method, the event is generated as soon as control is returned to a Java programming language
12590      method. Exception catch events are generated for any exception for which
12591      a throw was detected in a Java programming language method.
12592      Note that finally clauses are implemented as catch and re-throw. Therefore they
12593      will generate exception catch events.
12594      <p/>
12595      The <code>method</code> and <code>location</code>
12596      parameters uniquely identify the current location
12597      and allow the mapping to source file and line number when that information is
12598      available. For exceptions caught in a Java programming language method, the
12599      <code>exception</code> object identifies the exception object. Exceptions
12600      caught in native methods are not necessarily available by the time the
12601      exception catch is reported, so the <code>exception</code> field is set
12602      to <code>NULL</code>.
12603    </description>
12604    <origin>jvmdi</origin>
12605    <capabilities>
12606      <required id="can_generate_exception_events"></required>
12607    </capabilities>
12608    <parameters>
12609      <param id="jni_env">
12610        <outptr>
12611          <struct>JNIEnv</struct>
12612        </outptr>
12613          <description>
12614            The JNI environment of the event (current) thread
12615          </description>
12616      </param>
12617      <param id="thread">
12618	<jthread/>
12619	  <description>
12620	    Thread catching the exception
12621	  </description>
12622      </param>
12623      <param id="klass">
12624	<jclass method="method"/>
12625	  <description>
12626	    Class catching the exception
12627	  </description>
12628      </param>
12629      <param id="method">
12630	<jmethodID class="klass"/>
12631	  <description>
12632	    Method catching the exception
12633	  </description>
12634      </param>
12635      <param id="location">
12636	<jlocation/>
12637	<description>
12638	  Location where exception is being caught
12639	</description>
12640      </param>
12641      <param id="exception">
12642	<jobject/>
12643	  <description>
12644	    Exception being caught
12645	  </description>
12646      </param>
12647    </parameters>
12648  </event>
12649
12650  <event label="Thread Start"
12651	 id="ThreadStart" const="JVMTI_EVENT_THREAD_START" num="52" phase="start">
12652    <description>
12653      Thread start events are generated by a new thread before its initial
12654      method executes.
12655      <p/>
12656      A thread may be listed in the array returned by
12657      <functionlink id="GetAllThreads"></functionlink>
12658      before its thread start event is generated.
12659      It is possible for other events to be generated
12660      on a thread before its thread start event.
12661      <p/>
12662      The event is sent on the newly started <paramlink id="thread"></paramlink>.
12663    </description>
12664    <origin>jvmdi</origin>
12665    <capabilities>
12666    </capabilities>
12667    <parameters>
12668      <param id="jni_env">
12669        <outptr>
12670          <struct>JNIEnv</struct>
12671        </outptr>
12672          <description>
12673            The JNI environment of the event (current) thread.
12674          </description>
12675      </param>
12676      <param id="thread">
12677	<jthread/>
12678	  <description>
12679	    Thread starting
12680	  </description>
12681      </param>
12682    </parameters>
12683  </event>
12684
12685  <event label="Thread End"
12686	 id="ThreadEnd" const="JVMTI_EVENT_THREAD_END" filtered="thread" num="53" phase="start">
12687    <description>
12688      Thread end events are generated by a terminating thread
12689      after its initial method has finished execution.
12690      <p/>
12691      A thread may be listed in the array returned by
12692      <functionlink id="GetAllThreads"></functionlink>
12693      after its thread end event is generated.
12694      No events are generated on a thread
12695      after its thread end event.
12696      <p/>
12697      The event is sent on the dying <paramlink id="thread"></paramlink>.
12698    </description>
12699    <origin>jvmdi</origin>
12700    <capabilities>
12701    </capabilities>
12702    <parameters>
12703      <param id="jni_env">
12704        <outptr>
12705          <struct>JNIEnv</struct>
12706        </outptr>
12707          <description>
12708            The JNI environment of the event (current) thread.
12709          </description>
12710      </param>
12711      <param id="thread">
12712	<jthread/>
12713	  <description>
12714	    Thread ending
12715	  </description>
12716      </param>
12717    </parameters>
12718  </event>
12719
12720  <event label="Class Load"
12721	 id="ClassLoad" const="JVMTI_EVENT_CLASS_LOAD" filtered="thread" phase="start" num="55">
12722    <description>
12723      A class load event is generated when a class is first loaded. The order
12724      of class load events generated by a particular thread are guaranteed
12725      to match the order of class loading within that thread.
12726      Array class creation does not generate a class load event.
12727      The creation of a primitive class (for example, java.lang.Integer.TYPE)
12728      does not generate a class load event.
12729      <p/>
12730      This event is sent at an early stage in loading the class. As
12731      a result the class should be used carefully.  Note, for example,
12732      that methods and fields are not yet loaded, so queries for methods,
12733      fields, subclasses, and so on will not give correct results.
12734      See "Loading of Classes and Interfaces" in the <i>Java Language
12735      Specification</i>.  For most
12736      purposes the <eventlink id="ClassPrepare"></eventlink> event will
12737      be more useful.
12738    </description>
12739    <origin>jvmdi</origin>
12740    <capabilities>
12741    </capabilities>
12742    <parameters>
12743      <param id="jni_env">
12744        <outptr>
12745          <struct>JNIEnv</struct>
12746        </outptr>
12747          <description>
12748            The JNI environment of the event (current) thread
12749          </description>
12750      </param>
12751      <param id="thread">
12752	<jthread/>
12753	  <description>
12754	    Thread loading the class
12755	  </description>
12756      </param>
12757      <param id="klass">
12758	<jclass/>
12759	  <description>
12760	    Class being loaded
12761	  </description>
12762      </param>
12763    </parameters>
12764  </event>
12765
12766  <elide>
12767  <event label="Class Unload"
12768	 id="ClassUnload" const="JVMTI_EVENT_CLASS_UNLOAD" num="57">
12769    <description>
12770      A class unload event is generated when the class is about to be unloaded.
12771      Class unload events take place during garbage collection and must be
12772      handled extremely carefully. The garbage collector holds many locks
12773      and has suspended all other threads, so the event handler cannot depend
12774      on the ability to acquire any locks. The class unload event handler should
12775      do as little as possible, perhaps by queuing information to be processed
12776      later.  In particular, the <code>jclass</code> should be used only in
12777      the JNI function <code>isSameObject</code> or in the following <jvmti/> functions:
12778      <ul>
12779	<li><functionlink id="GetClassSignature"></functionlink></li>
12780	<li><functionlink id="GetSourceFileName"></functionlink></li>
12781	<li><functionlink id="IsInterface"></functionlink></li>
12782	<li><functionlink id="IsArrayClass"></functionlink></li>
12783      </ul>
12784    </description>
12785    <origin>jvmdi</origin>
12786    <capabilities>
12787    </capabilities>
12788    <parameters>
12789      <param id="jni_env">
12790        <outptr>
12791          <struct>JNIEnv</struct>
12792        </outptr>
12793          <description>
12794            The JNI environment of the event (current) thread
12795          </description>
12796      </param>
12797      <param id="thread">
12798	<jthread/>
12799	  <description>
12800	    Thread generating the class unload
12801	  </description>
12802      </param>
12803      <param id="klass">
12804	<jclass/>
12805	  <description>
12806	    Class being unloaded
12807	  </description>
12808      </param>
12809    </parameters>
12810  </event>
12811  </elide>
12812
12813  <event label="Class Prepare"
12814	 id="ClassPrepare" const="JVMTI_EVENT_CLASS_PREPARE" filtered="thread" phase="start" num="56">
12815    <description>
12816      A class prepare event is generated when class preparation is complete.
12817      At this point, class fields, methods, and implemented interfaces are
12818      available, and no code from the class has been executed. Since array
12819      classes never have fields or methods, class prepare events are not
12820      generated for them. Class prepare events are not generated for
12821      primitive classes (for example, <code>java.lang.Integer.TYPE</code>).
12822    </description>
12823    <origin>jvmdi</origin>
12824    <capabilities>
12825    </capabilities>
12826    <parameters>
12827      <param id="jni_env">
12828        <outptr>
12829          <struct>JNIEnv</struct>
12830        </outptr>
12831          <description>
12832            The JNI environment of the event (current) thread
12833          </description>
12834      </param>
12835      <param id="thread">
12836	<jthread/>
12837	  <description>
12838	    Thread generating the class prepare
12839	  </description>
12840      </param>
12841      <param id="klass">
12842	<jclass/>
12843	  <description>
12844	    Class being prepared
12845	  </description>
12846      </param>
12847    </parameters>
12848  </event>
12849
12850  <event label="Class File Load Hook" phase="any"
12851	 id="ClassFileLoadHook" const="JVMTI_EVENT_CLASS_FILE_LOAD_HOOK" num="54">
12852    <description>
12853      This event is sent when the VM obtains class file data,
12854      but before it constructs
12855      the in-memory representation for that class.
12856      This event is also sent when the class is being modified by the
12857      <functionlink id="RetransformClasses"/> function or
12858      the <functionlink id="RedefineClasses"/> function,
12859      called in any <jvmti/> environment.
12860      The agent can instrument
12861      the existing class file data sent by the VM to include profiling/debugging hooks.
12862      See the description of
12863      <internallink id="bci">bytecode instrumentation</internallink>
12864      for usage information.
12865      <p/>
12866    When the capabilities
12867    <internallink id="jvmtiCapabilities.can_generate_early_class_hook_events">
12868    <code>can_generate_early_class_hook_events</code></internallink> and
12869    <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
12870    <code>can_generate_all_class_hook_events</code></internallink>
12871    are enabled then this event may be sent in the primordial phase.
12872    Otherwise, this event may be sent before the VM is initialized (the start
12873    <functionlink id="GetPhase">phase</functionlink>).
12874    Some classes might not be compatible
12875    with the function (eg. ROMized classes or implementation defined classes) and this event will
12876    not be generated for these classes.
12877    <p/>
12878    The agent must allocate the space for the modified
12879    class file data buffer
12880    using the memory allocation function
12881    <functionlink id="Allocate"></functionlink> because the
12882    VM is responsible for freeing the new class file data buffer
12883    using <functionlink id="Deallocate"></functionlink>.
12884    <p/>
12885    If the agent wishes to modify the class file, it must set
12886    <code>new_class_data</code> to point
12887    to the newly instrumented class file data buffer and set
12888    <code>new_class_data_len</code> to the length of that
12889    buffer before returning
12890    from this call.  If no modification is desired, the agent simply
12891    does not set <code>new_class_data</code>.  If multiple agents
12892    have enabled this event the results are chained. That is, if
12893    <code>new_class_data</code> has been set, it becomes the
12894    <code>class_data</code> for the next agent.
12895    <p/>
12896    When handling a class load in the live phase, then the
12897    <functionlink id="GetNamedModule"></functionlink>
12898    function can be used to map class loader and a package name to a module.
12899    When a class is being redefined or retransformed then
12900    <code>class_being_redefined</code> is non <code>NULL</code> and so
12901    the JNI <code>GetModule</code> function can also be used
12902    to obtain the Module.
12903    <p/>
12904    The order that this event is sent to each environment differs
12905    from other events.
12906    This event is sent to environments in the following order:
12907    <ul>
12908      <li><fieldlink id="can_retransform_classes"
12909                     struct="jvmtiCapabilities">retransformation
12910                                                incapable</fieldlink>
12911          environments, in the
12912          order in which they were created
12913      </li>
12914      <li><fieldlink id="can_retransform_classes"
12915                     struct="jvmtiCapabilities">retransformation
12916                                                capable</fieldlink>
12917          environments, in the
12918          order in which they were created
12919      </li>
12920    </ul>
12921    When triggered by <functionlink id="RetransformClasses"/>,
12922    this event is sent only to <fieldlink id="can_retransform_classes"
12923                     struct="jvmtiCapabilities">retransformation
12924                                                capable</fieldlink>
12925    environments.
12926  </description>
12927  <origin>jvmpi</origin>
12928    <capabilities>
12929      <capability id="can_generate_all_class_hook_events"></capability>
12930      <capability id="can_generate_early_class_hook_events"></capability>
12931    </capabilities>
12932    <parameters>
12933      <param id="jni_env">
12934        <outptr>
12935          <struct>JNIEnv</struct>
12936        </outptr>
12937          <description>
12938            The JNI environment of the event (current) thread.
12939          </description>
12940      </param>
12941      <param id="class_being_redefined">
12942	<jclass/>
12943	<description>
12944	  The class being
12945          <functionlink id="RedefineClasses">redefined</functionlink> or
12946          <functionlink id="RetransformClasses">retransformed</functionlink>.
12947          <code>NULL</code> if sent by class load.
12948	</description>
12949      </param>
12950      <param id="loader">
12951	<jobject/>
12952	  <description>
12953	    The class loader loading the class.
12954            <code>NULL</code> if the bootstrap class loader.
12955	  </description>
12956      </param>
12957      <param id="name">
12958	<vmbuf><char/></vmbuf>
12959	<description>
12960            Name of class being loaded as a VM internal qualified name
12961            (for example, "java/util/List"), encoded as a
12962	    <internallink id="mUTF">modified UTF-8</internallink> string.
12963            Note: if the class is defined with a <code>NULL</code> name or
12964            without a name specified, <code>name</code> will be <code>NULL</code>.
12965	</description>
12966      </param>
12967      <param id="protection_domain">
12968	<jobject/>
12969	<description>
12970	  The <code>ProtectionDomain</code> of the class.
12971	</description>
12972      </param>
12973      <param id="class_data_len">
12974	<jint/>
12975	<description>
12976	  Length of current class file data buffer.
12977	</description>
12978      </param>
12979      <param id="class_data">
12980	<vmbuf><uchar/></vmbuf>
12981	<description>
12982	  Pointer to the current class file data buffer.
12983	</description>
12984      </param>
12985      <param id="new_class_data_len">
12986	<outptr><jint/></outptr>
12987	<description>
12988	  Pointer to the length of the new class file data buffer.
12989	</description>
12990      </param>
12991      <param id="new_class_data">
12992        <agentbuf incount="new_class_data_len"><uchar/></agentbuf>
12993	<description>
12994	  Pointer to the pointer to the instrumented class file data buffer.
12995	</description>
12996      </param>
12997    </parameters>
12998  </event>
12999
13000  <event label="VM Start Event"
13001	 id="VMStart" const="JVMTI_EVENT_VM_START" num="57" phase="start">
13002    <description>
13003      The VM start event signals the start of the VM.
13004      At this time JNI is live but the VM is not yet fully initialized.
13005      Once this event is generated, the agent is free to call any JNI function.
13006      This event signals the beginning of the start phase,
13007      <jvmti/> functions permitted in the start phase may be called.
13008      <p/>
13009      The timing of this event may depend on whether the agent has added the
13010      <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
13011      <code>can_generate_early_vmstart</code></internallink> capability or not.
13012      If the capability has been added then the VM posts the event as early
13013      as possible. The VM is capable of executing bytecode but it may not have
13014      initialized to the point where it can load classes in modules other than
13015      <code>java.base</code>, or even arbitrary classes in <code>java.base</code>.
13016      Agents that do load-time instrumentation in this
13017      phase must take great care when instrumenting code that potentially
13018      executes in this phase. Extreme care should also be taken with JNI
13019      <code>FindClass</code> as it may not be possible to load classes and attempts
13020      to do so may result in unpredictable behavior, maybe even stability issues
13021      on some VM implementations.
13022      If the capability has not been added then the VM delays posting this
13023      event until it is capable of loading classes in modules other than
13024      <code>java.base</code> or the VM has completed its initialization.
13025      Agents that create more than one JVM TI environment, where the
13026      capability is added to some but not all environments, may observe the
13027      start phase beginning earlier in the JVM TI environments that possess
13028      the capability.
13029      <p/>
13030      In the case of VM start-up failure, this event will not be sent.
13031    </description>
13032    <origin>jvmdi</origin>
13033    <capabilities>
13034    </capabilities>
13035    <parameters>
13036      <param id="jni_env">
13037        <outptr>
13038          <struct>JNIEnv</struct>
13039        </outptr>
13040          <description>
13041            The JNI environment of the event (current) thread.
13042          </description>
13043      </param>
13044    </parameters>
13045  </event>
13046
13047  <event label="VM Initialization Event"
13048	 id="VMInit" const="JVMTI_EVENT_VM_INIT" num="50">
13049    <description>
13050      The VM initialization event signals the completion of VM initialization. Once
13051      this event is generated, the agent is free to call any JNI or <jvmti/>
13052      function. The VM initialization event can be preceded by or can be concurrent
13053      with other events, but
13054      the preceding events should be handled carefully, if at all, because the
13055      VM has not completed its initialization. The thread start event for the
13056      main application thread is guaranteed not to occur until after the
13057      handler for the VM initialization event returns.
13058      <p/>
13059      In the case of VM start-up failure, this event will not be sent.
13060    </description>
13061    <origin>jvmdi</origin>
13062    <capabilities>
13063    </capabilities>
13064    <parameters>
13065      <param id="jni_env">
13066        <outptr>
13067          <struct>JNIEnv</struct>
13068        </outptr>
13069          <description>
13070            The JNI environment of the event (current) thread.
13071          </description>
13072      </param>
13073      <param id="thread">
13074	<jthread/>
13075	  <description>
13076	    The initial thread
13077	  </description>
13078      </param>
13079    </parameters>
13080  </event>
13081
13082  <event label="VM Death Event"
13083	 id="VMDeath" const="JVMTI_EVENT_VM_DEATH" num="51">
13084    <description>
13085      The VM death event notifies the agent of the termination of the VM.
13086      No events will occur after the VMDeath event.
13087      <p/>
13088      In the case of VM start-up failure, this event will not be sent.
13089      Note that <internallink id="onunload">Agent_OnUnload</internallink>
13090      will still be called in these cases.
13091    </description>
13092    <origin>jvmdi</origin>
13093    <capabilities>
13094    </capabilities>
13095    <parameters>
13096      <param id="jni_env">
13097        <outptr>
13098          <struct>JNIEnv</struct>
13099        </outptr>
13100          <description>
13101            The JNI environment of the event (current) thread
13102          </description>
13103      </param>
13104    </parameters>
13105  </event>
13106
13107  <event label="Compiled Method Load" phase="start"
13108	 id="CompiledMethodLoad" const="JVMTI_EVENT_COMPILED_METHOD_LOAD" num="68">
13109    <description>
13110      Sent when a method is compiled and loaded into memory by the VM.
13111      If it is unloaded, the <eventlink id="CompiledMethodUnload"/> event is sent.
13112      If it is moved, the <eventlink id="CompiledMethodUnload"/> event is sent,
13113      followed by a new <code>CompiledMethodLoad</code> event.
13114      Note that a single method may have multiple compiled forms, and that
13115      this event will be sent for each form.
13116      Note also that several methods may be inlined into a single
13117      address range, and that this event will be sent for each method.
13118      <p/>
13119      These events can be sent after their initial occurrence with
13120      <functionlink id="GenerateEvents"></functionlink>.
13121    </description>
13122    <origin>jvmpi</origin>
13123    <typedef id="jvmtiAddrLocationMap" label="Native address to location entry">
13124      <field id="start_address">
13125	<vmbuf><void/></vmbuf>
13126	<description>
13127	  Starting native address of code corresponding to a location
13128	</description>
13129      </field>
13130      <field id="location">
13131	<jlocation/>
13132	<description>
13133	  Corresponding location. See
13134	  <functionlink id="GetJLocationFormat"></functionlink>
13135	  for the meaning of location.
13136	</description>
13137      </field>
13138    </typedef>
13139    <capabilities>
13140      <required id="can_generate_compiled_method_load_events"></required>
13141    </capabilities>
13142    <parameters>
13143      <param id="klass">
13144	<jclass method="method"/>
13145	  <description>
13146	    Class of the method being compiled and loaded
13147	  </description>
13148      </param>
13149      <param id="method">
13150	<jmethodID class="klass"/>
13151	  <description>
13152	    Method being compiled and loaded
13153	  </description>
13154      </param>
13155      <param id="code_size">
13156	<jint/>
13157	<description>
13158	  Size of compiled code
13159	</description>
13160      </param>
13161      <param id="code_addr">
13162	<vmbuf><void/></vmbuf>
13163	<description>
13164	  Address where compiled method code is loaded
13165	</description>
13166      </param>
13167      <param id="map_length">
13168	<jint/>
13169	<description>
13170	  Number of <typelink id="jvmtiAddrLocationMap"></typelink>
13171	  entries in the address map.
13172	  Zero if mapping information cannot be supplied.
13173	</description>
13174      </param>
13175      <param id="map">
13176	<vmbuf><struct>jvmtiAddrLocationMap</struct></vmbuf>
13177	<description>
13178	  Map from native addresses to location.
13179	  The native address range of each entry is from
13180	  <fieldlink id="start_address" struct="jvmtiAddrLocationMap"></fieldlink>
13181	  to <code>start_address-1</code> of the next entry.
13182	  <code>NULL</code> if mapping information cannot be supplied.
13183	</description>
13184      </param>
13185      <param id="compile_info">
13186	<vmbuf><void/></vmbuf>
13187	<description>
13188	  VM-specific compilation information.
13189	  The referenced compile information is managed by the VM
13190	  and must not depend on the agent for collection.
13191	  A VM implementation defines the content and lifetime
13192	  of the information.
13193	</description>
13194      </param>
13195    </parameters>
13196  </event>
13197
13198  <event label="Compiled Method Unload" phase="start"
13199	 id="CompiledMethodUnload" const="JVMTI_EVENT_COMPILED_METHOD_UNLOAD" num="69">
13200    <description>
13201      Sent when a compiled method is unloaded from memory.
13202      This event might not be sent on the thread which performed the unload.
13203      This event may be sent sometime after the unload occurs, but
13204      will be sent before the memory is reused
13205      by a newly generated compiled method. This event may be sent after
13206      the class is unloaded.
13207    </description>
13208    <origin>jvmpi</origin>
13209    <capabilities>
13210      <required id="can_generate_compiled_method_load_events"></required>
13211    </capabilities>
13212    <parameters>
13213      <param id="klass">
13214	<jclass method="method"/>
13215	  <description>
13216	    Class of the compiled method being unloaded.
13217	  </description>
13218      </param>
13219      <param id="method">
13220	<jmethodID class="klass"/>
13221	  <description>
13222	    Compiled method being unloaded.
13223	    For identification of the compiled method only -- the class
13224	    may be unloaded and therefore the method should not be used
13225	    as an argument to further JNI or <jvmti/> functions.
13226	  </description>
13227      </param>
13228      <param id="code_addr">
13229	<vmbuf><void/></vmbuf>
13230	<description>
13231	  Address where compiled method code was loaded.
13232          For identification of the compiled method only --
13233          the space may have been reclaimed.
13234	</description>
13235      </param>
13236    </parameters>
13237  </event>
13238
13239  <event label="Dynamic Code Generated" phase="any"
13240	 id="DynamicCodeGenerated" const="JVMTI_EVENT_DYNAMIC_CODE_GENERATED" num="70">
13241    <description>
13242      Sent when a component of the virtual machine is generated dynamically.
13243      This does not correspond to Java programming language code that is
13244      compiled--see <eventlink id="CompiledMethodLoad"></eventlink>.
13245      This is for native code--for example, an interpreter that is generated
13246      differently depending on command-line options.
13247      <p/>
13248      Note that this event has no controlling capability.
13249      If a VM cannot generate these events, it simply does not send any.
13250      <p/>
13251      These events can be sent after their initial occurrence with
13252      <functionlink id="GenerateEvents"></functionlink>.
13253    </description>
13254    <origin>jvmpi</origin>
13255    <capabilities>
13256    </capabilities>
13257    <parameters>
13258      <param id="name">
13259	<vmbuf><char/></vmbuf>
13260	<description>
13261	  Name of the code, encoded as a
13262	  <internallink id="mUTF">modified UTF-8</internallink> string.
13263          Intended for display to an end-user.
13264          The name might not be unique.
13265	</description>
13266      </param>
13267      <param id="address">
13268	<vmbuf><void/></vmbuf>
13269	<description>
13270	  Native address of the code
13271	</description>
13272      </param>
13273      <param id="length">
13274	<jint/>
13275	<description>
13276	  Length in bytes of the code
13277	</description>
13278      </param>
13279    </parameters>
13280  </event>
13281
13282  <event label="Data Dump Request"
13283	 id="DataDumpRequest" const="JVMTI_EVENT_DATA_DUMP_REQUEST" num="71">
13284    <description>
13285      Sent by the VM to request the agent to dump its data.  This
13286      is just a hint and the agent need not react to this event.
13287      This is useful for processing command-line signals from users.  For
13288      example, in the Java 2 SDK a CTRL-Break on Win32 and a CTRL-\ on Solaris
13289      causes the VM to send this event to the agent.
13290    </description>
13291    <origin>jvmpi</origin>
13292    <capabilities>
13293    </capabilities>
13294    <parameters>
13295    </parameters>
13296  </event>
13297
13298  <event label="Monitor Contended Enter"
13299	 id="MonitorContendedEnter" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTER" filtered="thread" num="75">
13300    <description>
13301      Sent when a thread is attempting to enter a Java programming language
13302      monitor already acquired by another thread.
13303    </description>
13304    <origin>jvmpi</origin>
13305    <capabilities>
13306      <required id="can_generate_monitor_events"></required>
13307    </capabilities>
13308    <parameters>
13309      <param id="jni_env">
13310        <outptr>
13311          <struct>JNIEnv</struct>
13312        </outptr>
13313          <description>
13314            The JNI environment of the event (current) thread
13315          </description>
13316      </param>
13317      <param id="thread">
13318	<jthread/>
13319	  <description>
13320	    JNI local reference to the thread
13321	    attempting to enter the monitor
13322	  </description>
13323      </param>
13324      <param id="object">
13325	<jobject/>
13326	  <description>
13327	    JNI local reference to the monitor
13328	  </description>
13329      </param>
13330    </parameters>
13331  </event>
13332
13333  <event label="Monitor Contended Entered"
13334	 id="MonitorContendedEntered" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTERED" filtered="thread" num="76">
13335    <description>
13336      Sent when a thread enters a Java programming language
13337      monitor after waiting for it to be released by another thread.
13338    </description>
13339    <origin>jvmpi</origin>
13340    <capabilities>
13341      <required id="can_generate_monitor_events"></required>
13342    </capabilities>
13343    <parameters>
13344      <param id="jni_env">
13345        <outptr>
13346          <struct>JNIEnv</struct>
13347        </outptr>
13348          <description>
13349            The JNI environment of the event (current) thread
13350          </description>
13351      </param>
13352      <param id="thread">
13353	<jthread/>
13354	  <description>
13355	    JNI local reference to the thread entering
13356	    the monitor
13357	  </description>
13358      </param>
13359      <param id="object">
13360	<jobject/>
13361	  <description>
13362	    JNI local reference to the monitor
13363	  </description>
13364      </param>
13365    </parameters>
13366  </event>
13367
13368  <event label="Monitor Wait"
13369	 id="MonitorWait" const="JVMTI_EVENT_MONITOR_WAIT" filtered="thread" num="73">
13370    <description>
13371      Sent when a thread is about to wait on an object.
13372    </description>
13373    <origin>jvmpi</origin>
13374    <capabilities>
13375      <required id="can_generate_monitor_events"></required>
13376    </capabilities>
13377    <parameters>
13378      <param id="jni_env">
13379        <outptr>
13380          <struct>JNIEnv</struct>
13381        </outptr>
13382          <description>
13383            The JNI environment of the event (current) thread
13384          </description>
13385      </param>
13386      <param id="thread">
13387	<jthread/>
13388	  <description>
13389	    JNI local reference to the thread about to wait
13390	  </description>
13391      </param>
13392      <param id="object">
13393	<jobject/>
13394	  <description>
13395	    JNI local reference to the monitor
13396	  </description>
13397      </param>
13398      <param id="timeout">
13399	<jlong/>
13400	<description>
13401	  The number of milliseconds the thread will wait
13402	</description>
13403      </param>
13404    </parameters>
13405  </event>
13406
13407  <event label="Monitor Waited"
13408	 id="MonitorWaited" const="JVMTI_EVENT_MONITOR_WAITED" filtered="thread" num="74">
13409    <description>
13410      Sent when a thread finishes waiting on an object.
13411    </description>
13412    <origin>jvmpi</origin>
13413    <capabilities>
13414      <required id="can_generate_monitor_events"></required>
13415    </capabilities>
13416    <parameters>
13417      <param id="jni_env">
13418        <outptr>
13419          <struct>JNIEnv</struct>
13420        </outptr>
13421          <description>
13422            The JNI environment of the event (current) thread
13423          </description>
13424      </param>
13425      <param id="thread">
13426	<jthread/>
13427	  <description>
13428	    JNI local reference to the thread that was finished waiting
13429	  </description>
13430      </param>
13431      <param id="object">
13432	<jobject/>
13433	  <description>
13434	    JNI local reference to the monitor.
13435	  </description>
13436      </param>
13437      <param id="timed_out">
13438	<jboolean/>
13439	<description>
13440	  True if the monitor timed out
13441	</description>
13442      </param>
13443    </parameters>
13444  </event>
13445
13446  <event label="Resource Exhausted"
13447	 id="ResourceExhausted" const="JVMTI_EVENT_RESOURCE_EXHAUSTED" num="80"
13448         since="1.1">
13449    <description>
13450      Sent when a VM resource needed by a running application has been exhausted.
13451      Except as required by the optional capabilities, the set of resources
13452      which report exhaustion is implementation dependent.
13453      <p/>
13454      The following bit flags define the properties of the resource exhaustion:
13455      <constants id="jvmtiResourceExhaustionFlags"
13456                 label="Resource Exhaustion Flags"
13457                 kind="bits"
13458                 since="1.1">
13459        <constant id="JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR" num="0x0001">
13460          After this event returns, the VM will throw a
13461          <code>java.lang.OutOfMemoryError</code>.
13462        </constant>
13463        <constant id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP" num="0x0002">
13464	  The VM was unable to allocate memory from the <tm>Java</tm>
13465          platform <i>heap</i>.
13466          The <i>heap</i> is the runtime
13467          data area from which memory for all class instances and
13468          arrays are allocated.
13469        </constant>
13470        <constant id="JVMTI_RESOURCE_EXHAUSTED_THREADS" num="0x0004">
13471	  The VM was unable to create a thread.
13472        </constant>
13473      </constants>
13474    </description>
13475    <origin>new</origin>
13476    <capabilities>
13477      <capability id="can_generate_resource_exhaustion_heap_events">
13478        Can generate events when the VM is unable to allocate memory from the
13479        <internallink id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP">heap</internallink>.
13480      </capability>
13481      <capability id="can_generate_resource_exhaustion_threads_events">
13482        Can generate events when the VM is unable to
13483        <internallink id="JVMTI_RESOURCE_EXHAUSTED_THREADS">create
13484        a thread</internallink>.
13485      </capability>
13486    </capabilities>
13487    <parameters>
13488      <param id="jni_env">
13489        <outptr>
13490          <struct>JNIEnv</struct>
13491        </outptr>
13492          <description>
13493            The JNI environment of the event (current) thread
13494          </description>
13495      </param>
13496      <param id="flags">
13497	<jint/>
13498        <description>
13499	  Flags defining the properties of the of resource exhaustion
13500	  as specified by the
13501          <internallink id="jvmtiResourceExhaustionFlags">Resource
13502          Exhaustion Flags</internallink>.
13503	  </description>
13504	</param>
13505      <param id="reserved">
13506	<vmbuf><void/></vmbuf>
13507	<description>
13508	  Reserved.
13509	</description>
13510      </param>
13511      <param id="description">
13512	<vmbuf><char/></vmbuf>
13513	<description>
13514	  Description of the resource exhaustion, encoded as a
13515	  <internallink id="mUTF">modified UTF-8</internallink> string.
13516	</description>
13517      </param>
13518    </parameters>
13519  </event>
13520
13521  <event label="VM Object Allocation"
13522	 id="VMObjectAlloc" const="JVMTI_EVENT_VM_OBJECT_ALLOC" num="84">
13523    <description>
13524      Sent when a method causes the virtual machine to directly allocate an
13525      Object visible to Java programming language code.
13526      Generally object allocation should be detected by instrumenting
13527      the bytecodes of allocating methods.
13528      Object allocation generated in native code by JNI function
13529      calls should be detected using
13530      <internallink id="jniIntercept">JNI function interception</internallink>.
13531      Some methods might not have associated bytecodes and are not
13532      native methods, they instead are executed directly by the
13533      VM. These methods should send this event.
13534      Virtual machines which are incapable of bytecode instrumentation
13535      for some or all of their methods can send this event.
13536
13537      Note that the <internallink
13538      id="SampledObjectAlloc">SampledObjectAlloc</internallink>
13539      event is triggered on all Java object allocations, including those
13540      caused by bytecode method execution, JNI method execution, and
13541      directly by VM methods.
13542      <p/>
13543      Typical examples where this event might be sent:
13544      <ul>
13545        <li>Reflection -- for example, <code>java.lang.Class.newInstance()</code></li>
13546        <li>Methods not represented by bytecodes -- for example, VM intrinsics and
13547            J2ME preloaded classes</li>
13548      </ul>
13549      Cases where this event would not be generated:
13550      <ul>
13551        <li>Allocation due to bytecodes -- for example, the <code>new</code>
13552            and <code>newarray</code> VM instructions</li>
13553        <li>Allocation due to JNI function calls -- for example,
13554            <code>AllocObject</code></li>
13555        <li>Allocations during VM initialization</li>
13556        <li>VM internal objects</li>
13557      </ul>
13558    </description>
13559    <origin>new</origin>
13560    <capabilities>
13561      <required id="can_generate_vm_object_alloc_events"></required>
13562    </capabilities>
13563    <parameters>
13564      <param id="jni_env">
13565	<outptr>
13566	  <struct>JNIEnv</struct>
13567	</outptr>
13568	  <description>
13569            The JNI environment of the event (current) thread
13570	  </description>
13571      </param>
13572      <param id="thread">
13573	<jthread/>
13574	  <description>
13575	    Thread allocating the object.
13576	  </description>
13577      </param>
13578      <param id="object">
13579	<jobject/>
13580	  <description>
13581	    JNI local reference to the object that was allocated.
13582	  </description>
13583      </param>
13584      <param id="object_klass">
13585	<jclass/>
13586	  <description>
13587	    JNI local reference to the class of the object.
13588	  </description>
13589      </param>
13590      <param id="size">
13591	<jlong/>
13592	<description>
13593	    Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
13594	</description>
13595      </param>
13596    </parameters>
13597  </event>
13598
13599  <event label="Sampled Object Allocation"
13600    id="SampledObjectAlloc" const="JVMTI_EVENT_SAMPLED_OBJECT_ALLOC" num="86" since="11">
13601    <description>
13602      Sent when an allocated object is sampled.
13603      By default, the sampling interval is set to 512KB. The sampling is semi-random to avoid
13604      pattern-based bias and provides an approximate overall average interval over long periods of
13605      sampling.
13606      <p/>
13607      Each thread tracks how many bytes it has allocated since it sent the last event.
13608      When the number of bytes exceeds the sampling interval, it will send another event.
13609      This implies that, on average, one object will be sampled every time a thread has
13610      allocated 512KB bytes since the last sample.
13611      <p/>
13612      Note that the sampler is pseudo-random: it will not sample every 512KB precisely.
13613      The goal of this is to ensure high quality sampling even if allocation is
13614      happening in a fixed pattern (i.e., the same set of objects are being allocated
13615      every 512KB).
13616      <p/>
13617      If another sampling interval is required, the user can call
13618      <functionlink id="SetHeapSamplingInterval"></functionlink> with a strictly positive integer value,
13619      representing the new sampling interval.
13620      <p/>
13621      This event is sent once the sampled allocation has been performed.  It provides the object, stack trace
13622      of the allocation, the thread allocating, the size of allocation, and the object's class.
13623      <p/>
13624      A typical use case of this system is to determine where heap allocations originate.
13625      In conjunction with weak references and the function
13626      <functionlink id="GetStackTrace"></functionlink>, a user can track which objects were allocated from which
13627      stack trace, and which are still live during the execution of the program.
13628    </description>
13629    <origin>new</origin>
13630    <capabilities>
13631      <required id="can_generate_sampled_object_alloc_events"></required>
13632    </capabilities>
13633    <parameters>
13634      <param id="jni_env">
13635        <outptr>
13636          <struct>JNIEnv</struct>
13637        </outptr>
13638        <description>
13639          The JNI environment of the event (current) thread.
13640        </description>
13641      </param>
13642      <param id="thread">
13643        <jthread/>
13644        <description>
13645          Thread allocating the object.
13646        </description>
13647      </param>
13648      <param id="object">
13649        <jobject/>
13650        <description>
13651          JNI local reference to the object that was allocated.
13652        </description>
13653      </param>
13654      <param id="object_klass">
13655        <jclass/>
13656        <description>
13657          JNI local reference to the class of the object
13658        </description>
13659      </param>
13660      <param id="size">
13661        <jlong/>
13662        <description>
13663          Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
13664        </description>
13665      </param>
13666    </parameters>
13667  </event>
13668
13669  <event label="Object Free"
13670        id="ObjectFree" const="JVMTI_EVENT_OBJECT_FREE" num="83">
13671    <description>
13672      An Object Free event is sent when the garbage collector frees an object.
13673      Events are only sent for tagged objects--see
13674      <internallink id="Heap">heap functions</internallink>.
13675      <p/>
13676      The event handler must not use JNI functions and
13677      must not use <jvmti/> functions except those which
13678      specifically allow such use (see the raw monitor, memory management,
13679      and environment local storage functions).
13680    </description>
13681    <origin>new</origin>
13682    <capabilities>
13683      <required id="can_generate_object_free_events"></required>
13684    </capabilities>
13685    <parameters>
13686      <param id="tag">
13687	<jlong/>
13688	<description>
13689	  The freed object's tag
13690	</description>
13691      </param>
13692    </parameters>
13693  </event>
13694
13695  <event label="Garbage Collection Start"
13696	 id="GarbageCollectionStart" const="JVMTI_EVENT_GARBAGE_COLLECTION_START" num="81">
13697    <description>
13698      A Garbage Collection Start event is sent when a
13699      garbage collection pause begins.
13700      Only stop-the-world collections are reported--that is, collections during
13701      which all threads cease to modify the state of the Java virtual machine.
13702      This means that some collectors will never generate these events.
13703      This event is sent while the VM is still stopped, thus
13704      the event handler must not use JNI functions and
13705      must not use <jvmti/> functions except those which
13706      specifically allow such use (see the raw monitor, memory management,
13707      and environment local storage functions).
13708      <p/>
13709      This event is always sent as a matched pair with
13710      <eventlink id="GarbageCollectionFinish"/>
13711      (assuming both events are enabled) and no garbage collection
13712      events will occur between them.
13713    </description>
13714    <origin>new</origin>
13715    <capabilities>
13716      <required id="can_generate_garbage_collection_events"></required>
13717    </capabilities>
13718    <parameters>
13719    </parameters>
13720  </event>
13721
13722  <event label="Garbage Collection Finish"
13723	 id="GarbageCollectionFinish" const="JVMTI_EVENT_GARBAGE_COLLECTION_FINISH" num="82">
13724    <description>
13725      A Garbage Collection Finish event is sent when a
13726      garbage collection pause ends.
13727      This event is sent while the VM is still stopped, thus
13728      the event handler must not use JNI functions and
13729      must not use <jvmti/> functions except those which
13730      specifically allow such use (see the raw monitor, memory management,
13731      and environment local storage functions).
13732      <p/>
13733      Some agents may need to do post garbage collection operations that
13734      require the use of the disallowed <jvmti/> or JNI functions. For these
13735      cases an agent thread can be created which waits on a raw monitor,
13736      and the handler for the Garbage Collection Finish event simply
13737      notifies the raw monitor
13738      <p/>
13739      This event is always sent as a matched pair with
13740      <eventlink id="GarbageCollectionStart"/> (assuming both events are enabled).
13741      <issue>
13742	The most important use of this event is to provide timing information,
13743	and thus additional information is not required.  However,
13744	information about the collection which is "free" should be included -
13745        what that information is needs to be determined.
13746      </issue>
13747    </description>
13748    <origin>new</origin>
13749    <capabilities>
13750      <required id="can_generate_garbage_collection_events"></required>
13751    </capabilities>
13752    <parameters>
13753    </parameters>
13754  </event>
13755
13756  <elide>
13757  <event label="Verbose Output" phase="any"
13758	 id="VerboseOutput" const="JVMTI_EVENT_VERBOSE_OUTPUT" num="85">
13759    <description>
13760      Send verbose messages as strings.
13761	<issue>
13762	  This format is extremely fragile, as it can change with each
13763	  platform, collector and version.  Alternatives include:
13764	  <ul>
13765	    <li>building off Java programming language M and M APIs</li>
13766	    <li>XML</li>
13767	    <li>key/value pairs</li>
13768	    <li>removing it</li>
13769	  </ul>
13770	</issue>
13771	<issue>
13772	  Though this seemed trivial to implement.
13773          In the RI it appears this will be quite complex.
13774	</issue>
13775    </description>
13776    <origin>new</origin>
13777    <capabilities>
13778    </capabilities>
13779    <parameters>
13780      <param id="flag">
13781	<enum>jvmtiVerboseFlag</enum>
13782        <description>
13783          Which verbose output is being sent.
13784        </description>
13785      </param>
13786      <param id="message">
13787	<vmbuf><char/></vmbuf>
13788	<description>
13789	  Message text, encoded as a
13790	  <internallink id="mUTF">modified UTF-8</internallink> string.
13791	</description>
13792      </param>
13793    </parameters>
13794  </event>
13795  </elide>
13796
13797</eventsection>
13798
13799<datasection>
13800  <intro>
13801    <jvmti/> extends the data types defined by JNI.
13802  </intro>
13803  <basetypes id="jniTypes" label="JNI Types Used in the JVM Tool Interface">
13804    <basetype id="jboolean">
13805      <description>
13806	Holds a Java programming language <code>boolean</code>.
13807	Unsigned 8 bits.
13808      </description>
13809    </basetype>
13810    <basetype id="jchar">
13811      <description>
13812	Holds a Java programming language <code>char</code>.
13813	Unsigned 16 bits.
13814      </description>
13815    </basetype>
13816    <basetype id="jint">
13817      <description>
13818	Holds a Java programming language <code>int</code>.
13819	Signed 32 bits.
13820      </description>
13821    </basetype>
13822    <basetype id="jlong">
13823      <description>
13824	Holds a Java programming language <code>long</code>.
13825	Signed 64 bits.
13826      </description>
13827    </basetype>
13828    <basetype id="jfloat">
13829      <description>
13830	Holds a Java programming language <code>float</code>.
13831	32 bits.
13832      </description>
13833    </basetype>
13834    <basetype id="jdouble">
13835      <description>
13836	Holds a Java programming language <code>double</code>.
13837	64 bits.
13838      </description>
13839    </basetype>
13840    <basetype id="jobject">
13841      <description>
13842	Holds a Java programming language object.
13843      </description>
13844    </basetype>
13845    <basetype id="jclass">
13846      <description>
13847	Holds a Java programming language class.
13848      </description>
13849    </basetype>
13850    <basetype id="jvalue">
13851      <description>
13852	Is a union of all primitive types and <code>jobject</code>.  Thus, holds any Java
13853	programming language value.
13854      </description>
13855    </basetype>
13856    <basetype id="jfieldID">
13857      <description>
13858	Identifies a Java programming language field.
13859        <code>jfieldID</code>s returned by <jvmti/> functions and events may be
13860        safely stored.
13861      </description>
13862    </basetype>
13863    <basetype id="jmethodID">
13864      <description>
13865	Identifies a Java programming language method, initializer, or constructor.
13866        <code>jmethodID</code>s returned by <jvmti/> functions and events may be
13867        safely stored.  However, if the class is unloaded, they become invalid
13868        and must not be used.
13869      </description>
13870    </basetype>
13871    <basetype id="JNIEnv">
13872      <description>
13873	Pointer to the JNI function table.  Pointer to this (<code>JNIEnv *</code>)
13874	is a JNI environment.
13875      </description>
13876    </basetype>
13877  </basetypes>
13878
13879  <basetypes id="jvmtiTypes" label="JVM Tool Interface Base Types">
13880    <basetype id="jvmtiEnv">
13881      <description>
13882	The <jvmti/> <internallink id="environments">environment</internallink> pointer.
13883        See the <internallink id="FunctionSection">Function Section</internallink>.
13884        <code>jvmtiEnv</code> points to the
13885        <internallink id="FunctionTable">function table</internallink> pointer.
13886      </description>
13887    </basetype>
13888    <basetype id="jthread">
13889      <definition>typedef jobject jthread;</definition>
13890      <description>
13891	Subtype of <datalink id="jobject"></datalink> that holds a thread.
13892      </description>
13893    </basetype>
13894    <basetype id="jthreadGroup">
13895      <definition>typedef jobject jthreadGroup;</definition>
13896      <description>
13897	Subtype of <datalink id="jobject"></datalink> that holds a thread group.
13898      </description>
13899    </basetype>
13900    <basetype id="jlocation">
13901      <definition>typedef jlong jlocation;</definition>
13902      <description>
13903	A 64 bit value, representing a monotonically increasing
13904	executable position within a method.
13905        <code>-1</code> indicates a native method.
13906	See <functionlink id="GetJLocationFormat"></functionlink> for the format on a
13907	given VM.
13908      </description>
13909    </basetype>
13910    <basetype id="jrawMonitorID">
13911      <definition>struct _jrawMonitorID;
13912typedef struct _jrawMonitorID *jrawMonitorID;</definition>
13913      <description>
13914	A raw monitor.
13915      </description>
13916    </basetype>
13917    <basetype id="jvmtiError">
13918      <description>
13919	Holds an error return code.
13920	See the <internallink id="ErrorSection">Error section</internallink> for possible values.
13921	<example>
13922typedef enum {
13923    JVMTI_ERROR_NONE = 0,
13924    JVMTI_ERROR_INVALID_THREAD = 10,
13925      ...
13926} jvmtiError;
13927</example>
13928      </description>
13929    </basetype>
13930    <basetype id="jvmtiEvent">
13931      <description>
13932        An identifier for an event type.
13933	See the <internallink id="EventSection">Event section</internallink> for possible values.
13934        It is guaranteed that future versions of this specification will
13935        never assign zero as an event type identifier.
13936<example>
13937typedef enum {
13938    JVMTI_EVENT_SINGLE_STEP = 1,
13939    JVMTI_EVENT_BREAKPOINT = 2,
13940      ...
13941} jvmtiEvent;
13942</example>
13943      </description>
13944    </basetype>
13945    <basetype id="jvmtiEventCallbacks" name="eventCallbacks">
13946      <description>
13947        The callbacks used for events.
13948<example>
13949typedef struct {
13950    jvmtiEventVMInit VMInit;
13951    jvmtiEventVMDeath VMDeath;
13952      ...
13953} jvmtiEventCallbacks;
13954</example>
13955        See <internallink id="jvmtiEventCallbacks">event callbacks</internallink>
13956        for the complete structure.
13957        <p/>
13958        Where, for example, the VM initialization callback is defined:
13959<example>
13960typedef void (JNICALL *jvmtiEventVMInit)
13961    (jvmtiEnv *jvmti_env,
13962     JNIEnv* jni_env,
13963     jthread thread);
13964</example>
13965        See the individual events for the callback function definition.
13966      </description>
13967    </basetype>
13968    <basetype id="jniNativeInterface">
13969      <definition>typedef struct JNINativeInterface_ jniNativeInterface;</definition>
13970      <description>
13971	Typedef for the JNI function table <code>JNINativeInterface</code>
13972	defined in the
13973	<externallink id="jni/functions.html#interface-function-table">
13974          JNI Specification</externallink>.
13975	The JNI reference implementation defines this with an underscore.
13976      </description>
13977    </basetype>
13978  </basetypes>
13979
13980</datasection>
13981
13982<issuessection label="Issues">
13983  <intro id="suspendRequired" label="Resolved Issue: Suspend - Required or Automatic">
13984    JVMDI requires that the agent suspend threads before calling
13985    certain sensitive functions.  JVMPI requires garbage collection to be
13986    disabled before calling certain sensitive functions.
13987    It was suggested that rather than have this requirement, that
13988    VM place itself in a suitable state before performing an
13989    operation.  This makes considerable sense since each VM
13990    knows its requirements and can most easily arrange a
13991    safe state.
13992    <p/>
13993    The ability to externally suspend/resume threads will, of
13994    course, remain.  The ability to enable/disable garbage collection will not.
13995    <p/>
13996    This issue is resolved--suspend will not
13997    be required.  The spec has been updated to reflect this.
13998  </intro>
13999
14000  <intro id="stackSampling" label="Resolved Issue: Call Stack Sampling">
14001    There are a variety of approaches to sampling call stacks.
14002    The biggest bifurcation is between VM controlled and agent
14003    controlled.
14004    <p/>
14005    This issue is resolved--agent controlled
14006    sampling will be the approach.
14007  </intro>
14008
14009  <intro id="threadRepresentation" label="Resolved Issue: Thread Representation">
14010    JVMDI represents threads as jthread.  JVMPI primarily
14011    uses JNIEnv* to represent threads.
14012    <p/>
14013    The Expert Group has chosen jthread as the representation
14014    for threads in <jvmti/>.
14015    JNIEnv* is sent by
14016    events since it is needed to JNI functions.  JNIEnv, per the
14017    JNI spec, are not supposed to be used outside their thread.
14018  </intro>
14019
14020  <intro id="design" label="Resolved Issue: Method Representation">
14021    The JNI spec allows an implementation to depend on jclass/jmethodID
14022    pairs, rather than simply a jmethodID, to reference a method.
14023    JVMDI, for consistency, choose the same representation.
14024    JVMPI, however, specifies that a jmethodID alone maps to a
14025    method.  Both of the Sun <tm>J2SE</tm> virtual machines (Classic and <tm>HotSpot</tm>) store
14026    pointers in jmethodIDs, and as a result, a jmethodID is sufficient.
14027    In fact, any JVM implementation that supports JVMPI must have
14028    such a representation.
14029    <jvmti/> will use jmethodID as a unique representation of a method
14030    (no jclass is used).
14031    There should be efficiency gains, particularly in
14032    functionality like stack dumping, to this representation.
14033    <p/>
14034    Note that fields were not used in JVMPI and that the access profile
14035    of fields differs from methods--for implementation efficiency
14036    reasons, a jclass/jfieldID pair will still be needed for field
14037    reference.
14038  </intro>
14039
14040  <intro id="localReferenceIssue" label="Resolved Issue: Local References">
14041    Functions return local references.
14042  </intro>
14043
14044  <intro id="frameRep" label="Resolved Issue: Representation of frames">
14045    In JVMDI, a frame ID is used to represent a frame.  Problem with this
14046    is that a VM must track when a frame becomes invalid, a far better
14047    approach, and the one used in <jvmti/>, is to reference frames by depth.
14048  </intro>
14049
14050  <intro id="requiredCapabilities" label="Issue: Required Capabilities">
14051    Currently, having a required capabilities means that the functionality
14052    is optional.   Capabilities are useful even for required functionality
14053    since they can inform the VM is needed set-up.  Thus, there should be
14054    a set of capabilities that a conformant implementation must provide
14055    (if requested during Agent_OnLoad).
14056  </intro>
14057
14058  <intro id="taghint" label="Proposal: add tag hint function">
14059    A hint of the percentage of objects that will be tagged would
14060    help the VM pick a good implementation.
14061  </intro>
14062
14063  <intro id="moreMonitorQueries" label="Request: More Monitor Quires">
14064  How difficult or easy would be to extend the monitor_info category to include
14065    <pre>
14066  - current number of monitors
14067  - enumeration of monitors
14068  - enumeration of threads waiting on a given monitor
14069    </pre>
14070  The reason for my question is the fact that current get_monitor_info support
14071  requires the agent to specify a given thread to get the info which is probably
14072  OK in the profiling/debugging space, while in the monitoring space the agent
14073  could be watching the monitor list and then decide which thread to ask for
14074  the info. You might ask why is this important for monitoring .... I think it
14075  can aid in the detection/prediction of application contention caused by hot-locks.
14076  </intro>
14077</issuessection>
14078
14079<changehistory id="ChangeHistory" update="09/05/07">
14080  <intro>
14081    The <jvmti/> specification is an evolving document with major, minor,
14082    and micro version numbers.
14083    A released version of the specification is uniquely identified
14084    by its major and minor version.
14085    The functions, events, and capabilities in this specification
14086    indicate a "Since" value which is the major and minor version in
14087    which it was introduced.
14088    The version of the specification implemented by the VM can
14089    be retrieved at runtime with the <functionlink id="GetVersionNumber"/>
14090    function.
14091  </intro>
14092  <change date="14 Nov 2002">
14093    Converted to XML document.
14094  </change>
14095  <change date="14 Nov 2002">
14096    Elided heap dump functions (for now) since what was there
14097    was wrong.
14098  </change>
14099  <change date="18 Nov 2002">
14100    Added detail throughout.
14101  </change>
14102  <change date="18 Nov 2002">
14103    Changed JVMTI_THREAD_STATUS_RUNNING to JVMTI_THREAD_STATUS_RUNNABLE.
14104  </change>
14105  <change date="19 Nov 2002">
14106    Added AsyncGetStackTrace.
14107  </change>
14108  <change date="19 Nov 2002">
14109    Added jframeID return to GetStackTrace.
14110  </change>
14111  <change date="19 Nov 2002">
14112    Elided GetCurrentFrame and GetCallingFrame functions (for now) since what was there
14113    since they are redundant with GetStackTrace.
14114  </change>
14115  <change date="19 Nov 2002">
14116    Elided ClearAllBreakpoints since it has always been redundant.
14117  </change>
14118  <change date="19 Nov 2002">
14119    Added GetSystemProperties.
14120  </change>
14121  <change date="19 Nov 2002">
14122    Changed the thread local storage functions to use jthread.
14123  </change>
14124  <change date="20 Nov 2002">
14125    Added GetJLocationFormat.
14126  </change>
14127  <change date="22 Nov 2002">
14128    Added events and introductory text.
14129  </change>
14130  <change date="22 Nov 2002">
14131    Cross reference type and constant definitions.
14132  </change>
14133  <change date="24 Nov 2002">
14134    Added DTD.
14135  </change>
14136  <change date="24 Nov 2002">
14137    Added capabilities function section.
14138  </change>
14139  <change date="29 Nov 2002">
14140    Assign capabilities to each function and event.
14141  </change>
14142  <change date="29 Nov 2002">
14143    Add <internallink id="jniIntercept">JNI interception functions</internallink>.
14144  </change>
14145  <change date="30 Nov 2002">
14146    Auto generate SetEventNotificationMode capabilities.
14147  </change>
14148  <change date="30 Nov 2002">
14149    Add <eventlink id="VMObjectAlloc"></eventlink> event.
14150  </change>
14151  <change date="30 Nov 2002">
14152    Add <eventlink id="DynamicCodeGenerated"></eventlink> event.
14153  </change>
14154  <change date="30 Nov 2002">
14155    Add const to declarations.
14156  </change>
14157  <change date="30 Nov 2002">
14158    Change method exit and frame pop to send on exception.
14159  </change>
14160  <change date="1 Dec 2002">
14161    Add ForceGarbageCollection.
14162  </change>
14163  <change date="2 Dec 2002">
14164    Redo Xrun section; clarify GetStackTrace and add example;
14165    Fix width problems; use "agent" consistently.
14166  </change>
14167  <change date="8 Dec 2002">
14168    Remove previous start-up intro.
14169    Add <internallink id="environments"><jvmti/> Environments</internallink>
14170    section.
14171  </change>
14172  <change date="8 Dec 2002">
14173    Add <functionlink id="DisposeEnvironment"></functionlink>.
14174  </change>
14175  <change date="9 Dec 2002">
14176    Numerous minor updates.
14177  </change>
14178  <change date="15 Dec 2002">
14179    Add heap profiling functions added:
14180    get/set annotation, iterate live objects/heap.
14181    Add heap profiling functions place holder added:
14182    heap roots.
14183    Heap profiling event added: object free.
14184    Heap profiling event redesigned: vm object allocation.
14185    Heap profiling event placeholders added: garbage collection start/finish.
14186    Native method bind event added.
14187  </change>
14188  <change date="19 Dec 2002">
14189    Revamp suspend/resume functions.
14190    Add origin information with jvmdi tag.
14191    Misc fixes.
14192  </change>
14193  <change date="24 Dec 2002">
14194    Add semantics to types.
14195  </change>
14196  <change date="27 Dec 2002">
14197    Add local reference section.
14198    Autogenerate parameter descriptions from types.
14199  </change>
14200  <change date="28 Dec 2002">
14201    Document that RunAgentThread sends threadStart.
14202  </change>
14203  <change date="29 Dec 2002">
14204    Remove redundant local ref and dealloc warning.
14205    Convert GetRawMonitorName to allocated buffer.
14206    Add GenerateEvents.
14207  </change>
14208  <change date="30 Dec 2002">
14209    Make raw monitors a type and rename to "jrawMonitorID".
14210  </change>
14211  <change date="1 Jan 2003">
14212    Include origin information.
14213    Clean-up JVMDI issue references.
14214    Remove Deallocate warnings which are now automatically generated.
14215  </change>
14216  <change date="2 Jan 2003">
14217    Fix representation issues for jthread.
14218  </change>
14219  <change date="3 Jan 2003">
14220    Make capabilities buffered out to 64 bits - and do it automatically.
14221  </change>
14222  <change date="4 Jan 2003">
14223    Make constants which are enumeration into enum types.
14224    Parameters now of enum type.
14225    Clean-up and index type section.
14226    Replace remaining datadef entities with callback.
14227  </change>
14228  <change date="7 Jan 2003">
14229    Correct GenerateEvents description.
14230    More internal semantics work.
14231  </change>
14232  <change date="9 Jan 2003">
14233    Replace previous GetSystemProperties with two functions
14234    which use allocated information instead fixed.
14235    Add SetSystemProperty.
14236    More internal semantics work.
14237  </change>
14238  <change date="12 Jan 2003">
14239    Add varargs to end of SetEventNotificationMode.
14240  </change>
14241  <change date="20 Jan 2003">
14242    Finish fixing spec to reflect that alloc sizes are jlong.
14243  </change>
14244  <change date="22 Jan 2003">
14245    Allow NULL as RunAgentThread arg.
14246  </change>
14247  <change date="22 Jan 2003">
14248    Fixed names to standardized naming convention
14249    Removed AsyncGetStackTrace.
14250  </change>
14251  <change date="29 Jan 2003">
14252    Since we are using jthread, removed GetThread.
14253  </change>
14254  <change date="31 Jan 2003">
14255    Change GetFieldName to allow NULLs like GetMethodName.
14256  </change>
14257  <change date="29 Feb 2003" version="v40">
14258      Rewrite the introductory text, adding sections on
14259      start-up, environments and bytecode instrumentation.
14260      Change the command line arguments per EG discussions.
14261      Add an introduction to the capabilities section.
14262      Add the extension mechanism category and functions.
14263      Mark for deletion, but clarified anyhow, SuspendAllThreads.
14264      Rename IterateOverLiveObjects to IterateOverReachableObjects and
14265      change the text accordingly.
14266      Clarify IterateOverHeap.
14267      Clarify CompiledMethodLoad.
14268      Discuss prerequisite state for Calling Functions.
14269      Clarify SetAllocationHooks.
14270      Added issues ("To be resolved:") through-out.
14271      And so on...
14272  </change>
14273  <change date="6 Mar 2003" version="v41">
14274      Remove struct from the call to GetOwnedMonitorInfo.
14275      Automatically generate most error documentation, remove
14276      (rather broken) hand written error doc.
14277      Better describe capability use (empty initial set).
14278      Add min value to jint params.
14279      Remove the capability can_access_thread_local_storage.
14280      Rename error JVMTI_ERROR_NOT_IMPLEMENTED to JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
14281      same for *NOT_IMPLEMENTED.
14282      Description fixes.
14283  </change>
14284  <change date="8 Mar 2003" version="v42">
14285      Rename GetClassSignature to GetClassName.
14286      Rename IterateOverClassObjects to IterateOverInstancesOfClass.
14287      Remove GetMaxStack (operand stack isn't used in <jvmti/>).
14288      Description fixes: define launch-time, remove native frame pop
14289      from PopFrame, and assorted clarifications.
14290  </change>
14291  <change date="8 Mar 2003" version="v43">
14292      Fix minor editing problem.
14293  </change>
14294  <change date="10 Mar 2003" version="v44">
14295      Add phase information.
14296      Remap (compact) event numbers.
14297  </change>
14298  <change date="11 Mar 2003" version="v45">
14299      More phase information - allow "any".
14300      Elide raw monitor queries and events.
14301      Minor description fixes.
14302  </change>
14303  <change date="12 Mar 2003" version="v46">
14304      Add GetPhase.
14305      Use "phase" through document.
14306      Elide GetRawMonitorName.
14307      Elide GetObjectMonitors.
14308  </change>
14309  <change date="12 Mar 2003" version="v47">
14310      Fixes from link, XML, and spell checking.
14311      Auto-generate the callback structure.
14312  </change>
14313  <change date="13 Mar 2003" version="v48">
14314      One character XML fix.
14315  </change>
14316  <change date="13 Mar 2003" version="v49">
14317      Change function parameter names to be consistent with
14318      event parameters (fooBarBaz becomes foo_bar_baz).
14319  </change>
14320  <change date="14 Mar 2003" version="v50">
14321      Fix broken link.  Fix thread markers.
14322  </change>
14323  <change date="14 Mar 2003" version="v51">
14324      Change constants so they are under 128 to workaround
14325      compiler problems.
14326  </change>
14327  <change date="23 Mar 2003" version="v52">
14328      Overhaul capabilities.  Separate GetStackTrace into
14329      GetStackTrace and GetStackFrames.
14330  </change>
14331  <change date="8 Apr 2003" version="v54">
14332      Use depth instead of jframeID to reference frames.
14333      Remove the now irrelevant GetCurrentFrame, GetCallerFrame and GetStackFrames.
14334      Remove frame arg from events.
14335  </change>
14336  <change date="9 Apr 2003" version="v55">
14337      Remove GetObjectWithAnnotation since tests show bufferred approach more efficient.
14338      Add missing annotation_count to GetObjectsWithAnnotations
14339  </change>
14340  <change date="10 Apr 2003" version="v56">
14341      Remove confusing parenthetical statement in GetObjectsWithAnnotations
14342  </change>
14343  <change date="13 Apr 2003" version="v58">
14344      Replace jclass/jmethodID representation of method with simply jmethodID;
14345      Pass JvmtiEnv* as first arg of every event; remove JNIEnv* where inappropriate.
14346      Replace can_access_frames with can_access_local_variables; remove from purely stack access.
14347      Use can_get_synthetic_attribute; fix description.
14348      Clarify that zero length arrays must be deallocated.
14349      Clarify RelinquishCapabilities.
14350      Generalize JVMTI_ERROR_VM_DEAD to JVMTI_ERROR_WRONG_PHASE.
14351  </change>
14352  <change date="27 Apr 2003" version="v59">
14353      Remove lingering indirect references to OBSOLETE_METHOD_ID.
14354  </change>
14355  <change date="4 May 2003" version="v60">
14356      Allow DestroyRawMonitor during OnLoad.
14357  </change>
14358  <change date="7 May 2003" version="v61">
14359      Added not monitor owner error return to DestroyRawMonitor.
14360  </change>
14361  <change date="13 May 2003" version="v62">
14362      Clarify semantics of raw monitors.
14363      Change flags on <code>GetThreadStatus</code>.
14364      <code>GetClassLoader</code> return NULL for the bootstrap class loader.
14365      Add <code>GetClassName</code> issue.
14366      Define local variable signature.
14367      Disallow zero in annotations array of <code>GetObjectsWithAnnotations</code>.
14368      Remove over specification in <code>GetObjectsWithAnnotations</code>.
14369      Elide <code>SetAllocationHooks</code>.
14370      Elide <code>SuspendAllThreads</code>.
14371  </change>
14372  <change date="14 May 2003" version="v63">
14373      Define the data type <code>jvmtiEventCallbacks</code>.
14374      Zero length allocations return NULL.
14375      Keep SetAllocationHooks in JVMDI, but remove from <jvmti/>.
14376      Add JVMTI_THREAD_STATUS_FLAG_INTERRUPTED.
14377  </change>
14378  <change date="15 May 2003" version="v64">
14379      Better wording, per review.
14380  </change>
14381  <change date="15 May 2003" version="v65">
14382      First Alpha.
14383      Make jmethodID and jfieldID unique, jclass not used.
14384  </change>
14385  <change date="27 May 2003" version="v66">
14386      Fix minor XSLT errors.
14387  </change>
14388  <change date="13 June 2003" version="v67">
14389      Undo making jfieldID unique (jmethodID still is).
14390  </change>
14391  <change date="17 June 2003" version="v68">
14392      Changes per June 11th Expert Group meeting --
14393      Overhaul Heap functionality: single callback,
14394      remove GetHeapRoots, add reachable iterators,
14395      and rename "annotation" to "tag".
14396      NULL thread parameter on most functions is current
14397      thread.
14398      Add timers.
14399      Remove ForceExit.
14400      Add GetEnvironmentLocalStorage.
14401      Add verbose flag and event.
14402      Add AddToBootstrapClassLoaderSearch.
14403      Update ClassFileLoadHook.
14404  </change>
14405  <change date="18 June 2003" version="v69">
14406      Clean up issues sections.
14407      Rename GetClassName back to GetClassSignature and
14408      fix description.
14409      Add generic signature to GetClassSignature,
14410      GetFieldSignature, GetMethodSignature, and
14411      GetLocalVariableTable.
14412      Elide EstimateCostOfCapabilities.
14413      Clarify that the system property functions operate
14414      on the VM view of system properties.
14415      Clarify Agent_OnLoad.
14416      Remove "const" from JNIEnv* in events.
14417      Add metadata accessors.
14418  </change>
14419  <change date="18 June 2003" version="v70">
14420      Add start_depth to GetStackTrace.
14421      Move system properties to a new category.
14422      Add GetObjectSize.
14423      Remove "X" from command line flags.
14424      XML, HTML, and spell check corrections.
14425  </change>
14426  <change date="19 June 2003" version="v71">
14427      Fix JVMTI_HEAP_ROOT_THREAD to be 6.
14428      Make each synopsis match the function name.
14429      Fix unclear wording.
14430  </change>
14431  <change date="26 June 2003" version="v72">
14432      SetThreadLocalStorage and SetEnvironmentLocalStorage should allow value
14433      to be set to NULL.
14434      NotifyFramePop, GetFrameLocationm and all the local variable operations
14435      needed to have their wording about frames fixed.
14436      Grammar and clarity need to be fixed throughout.
14437      Capitalization and puntuation need to be consistent.
14438      Need micro version number and masks for accessing major, minor, and micro.
14439      The error code lists should indicate which must be returned by
14440      an implementation.
14441      The command line properties should be visible in the properties functions.
14442      Disallow popping from the current thread.
14443      Allow implementations to return opaque frame error when they cannot pop.
14444      The NativeMethodBind event should be sent during any phase.
14445      The DynamicCodeGenerated event should be sent during any phase.
14446      The following functions should be allowed to operate before VMInit:
14447	Set/GetEnvironmentLocalStorage
14448	GetMethodDeclaringClass
14449	GetClassSignature
14450	GetClassModifiers
14451	IsInterface
14452	IsArrayClass
14453	GetMethodName
14454	GetMethodModifiers
14455	GetMaxLocals
14456	GetArgumentsSize
14457	GetLineNumberTable
14458	GetMethodLocation
14459	IsMethodNative
14460	IsMethodSynthetic.
14461      Other changes (to XSL):
14462      Argument description should show asterisk after not before pointers.
14463      NotifyFramePop, GetFrameLocationm and all the local variable operations
14464      should hsve the NO_MORE_FRAMES error added.
14465      Not alive threads should have a different error return than invalid thread.
14466  </change>
14467  <change date="7 July 2003" version="v73">
14468      VerboseOutput event was missing message parameter.
14469      Minor fix-ups.
14470  </change>
14471  <change date="14 July 2003" version="v74">
14472      Technical Publications Department corrections.
14473      Allow thread and environment local storage to be set to NULL.
14474  </change>
14475  <change date="23 July 2003" version="v75">
14476      Use new Agent_OnLoad rather than overloaded JVM_OnLoad.
14477      Add JNICALL to callbacks (XSL).
14478      Document JNICALL requirement for both events and callbacks (XSL).
14479      Restrict RedefineClasses to methods and attributes.
14480      Elide the VerboseOutput event.
14481      VMObjectAlloc: restrict when event is sent and remove method parameter.
14482      Finish loose ends from Tech Pubs edit.
14483  </change>
14484  <change date="24 July 2003" version="v76">
14485      Change ClassFileLoadHook event to send the class instead of a boolean of redefine.
14486  </change>
14487  <change date="24 July 2003" version="v77">
14488      XML fixes.
14489      Minor text clarifications and corrections.
14490  </change>
14491  <change date="24 July 2003" version="v78">
14492      Remove GetExceptionHandlerTable and GetThrownExceptions from <jvmti/>.
14493      Clarify that stack frames are JVM Spec frames.
14494      Split can_get_source_info into can_get_source_file_name, can_get_line_numbers,
14495      and can_get_source_debug_extension.
14496      PopFrame cannot have a native calling method.
14497      Removed incorrect statement in GetClassloaderClasses
14498      (see <vmspec chapter="4.4"/>).
14499  </change>
14500  <change date="24 July 2003" version="v79">
14501      XML and text fixes.
14502      Move stack frame description into Stack Frame category.
14503  </change>
14504  <change date="26 July 2003" version="v80">
14505      Allow NULL (means bootstrap loader) for GetClassloaderClasses.
14506      Add new heap reference kinds for references from classes.
14507      Add timer information struct and query functions.
14508      Add AvailableProcessors.
14509      Rename GetOtherThreadCpuTime to GetThreadCpuTime.
14510      Explicitly add JVMTI_ERROR_INVALID_THREAD and JVMTI_ERROR_THREAD_NOT_ALIVE
14511      to SetEventNotification mode.
14512      Add initial thread to the VM_INIT event.
14513      Remove platform assumptions from AddToBootstrapClassLoaderSearch.
14514  </change>
14515  <change date="26 July 2003" version="v81">
14516      Grammar and clarity changes per review.
14517  </change>
14518  <change date="27 July 2003" version="v82">
14519      More grammar and clarity changes per review.
14520      Add Agent_OnUnload.
14521  </change>
14522  <change date="28 July 2003" version="v83">
14523      Change return type of Agent_OnUnload to void.
14524  </change>
14525  <change date="28 July 2003" version="v84">
14526      Rename JVMTI_REFERENCE_ARRAY to JVMTI_REFERENCE_ARRAY_ELEMENT.
14527  </change>
14528  <change date="28 July 2003" version="v85">
14529      Steal java.lang.Runtime.availableProcessors() wording for
14530      AvailableProcessors().
14531      Guarantee that zero will never be an event ID.
14532      Remove some issues which are no longer issues.
14533      Per review, rename and more completely document the timer
14534      information functions.
14535  </change>
14536  <change date="29 July 2003" version="v86">
14537      Non-spec visible change to XML controlled implementation:
14538        SetThreadLocalStorage must run in VM mode.
14539  </change>
14540  <change date="5 August 2003" version="0.1.87">
14541      Add GetErrorName.
14542      Add varargs warning to jvmtiExtensionEvent.
14543      Remove "const" on the jvmtiEnv* of jvmtiExtensionEvent.
14544      Remove unused can_get_exception_info capability.
14545      Pass jvmtiEnv* and JNIEnv* to the jvmtiStartFunction.
14546      Fix jvmtiExtensionFunctionInfo.func declared type.
14547      Extension function returns error code.
14548      Use new version numbering.
14549  </change>
14550  <change date="5 August 2003" version="0.2.88">
14551      Remove the ClassUnload event.
14552  </change>
14553  <change date="8 August 2003" version="0.2.89">
14554      Heap reference iterator callbacks return an enum that
14555      allows outgoing object references to be ignored.
14556      Allow JNIEnv as a param type to extension events/functions.
14557  </change>
14558  <change date="15 August 2003" version="0.2.90">
14559      Fix a typo.
14560  </change>
14561  <change date="2 September 2003" version="0.2.91">
14562      Remove all metadata functions: GetClassMetadata,
14563      GetFieldMetadata, and GetMethodMetadata.
14564  </change>
14565  <change date="1 October 2003" version="0.2.92">
14566      Mark the functions Allocate. Deallocate, RawMonitor*,
14567      SetEnvironmentLocalStorage, and GetEnvironmentLocalStorage
14568      as safe for use in heap callbacks and GC events.
14569  </change>
14570  <change date="24 November 2003" version="0.2.93">
14571      Add pass through opaque user data pointer to heap iterate
14572      functions and callbacks.
14573      In the CompiledMethodUnload event, send the code address.
14574      Add GarbageCollectionOccurred event.
14575      Add constant pool reference kind.
14576      Mark the functions CreateRawMonitor and DestroyRawMonitor
14577      as safe for use in heap callbacks and GC events.
14578      Clarify: VMDeath, GetCurrentThreadCpuTimerInfo,
14579      GetThreadCpuTimerInfo, IterateOverReachableObjects,
14580      IterateOverObjectsReachableFromObject, GetTime and
14581      JVMTI_ERROR_NULL_POINTER.
14582      Add missing errors to: GenerateEvents and
14583      AddToBootstrapClassLoaderSearch.
14584      Fix description of ClassFileLoadHook name parameter.
14585      In heap callbacks and GC/ObjectFree events, specify
14586      that only explicitly allowed functions can be called.
14587      Allow GetCurrentThreadCpuTimerInfo, GetCurrentThreadCpuTime,
14588      GetTimerInfo, and GetTime during callback.
14589      Allow calling SetTag/GetTag during the onload phase.
14590      SetEventNotificationMode, add: error attempted inappropriate
14591      thread level control.
14592      Remove jvmtiExceptionHandlerEntry.
14593      Fix handling of native methods on the stack --
14594      location_ptr param of GetFrameLocation, remove
14595      JVMTI_ERROR_OPAQUE_FRAME from GetFrameLocation,
14596      jvmtiFrameInfo.location, and jlocation.
14597      Remove typo (from JVMPI) implying that the MonitorWaited
14598      event is sent on sleep.
14599  </change>
14600  <change date="25 November 2003" version="0.2.94">
14601      Clarifications and typos.
14602  </change>
14603  <change date="3 December 2003" version="0.2.95">
14604      Allow NULL user_data in heap iterators.
14605  </change>
14606  <change date="28 January 2004" version="0.2.97">
14607      Add GetThreadState, deprecate GetThreadStatus.
14608  </change>
14609  <change date="29 January 2004" version="0.2.98">
14610      INVALID_SLOT and TYPE_MISMATCH errors should be optional.
14611  </change>
14612  <change date="12 February 2004" version="0.2.102">
14613      Remove MonitorContendedExit.
14614      Added JNIEnv parameter to VMObjectAlloc.
14615      Clarified definition of class_tag and referrer_index
14616      parameters to heap callbacks.
14617  </change>
14618  <change date="16 Febuary 2004" version="0.2.103">
14619      Document JAVA_TOOL_OPTIONS.
14620  </change>
14621  <change date="17 Febuary 2004" version="0.2.105">
14622      Divide start phase into primordial and start.
14623      Add VMStart event
14624      Change phase associations of functions and events.
14625  </change>
14626  <change date="18 Febuary 2004" version="0.3.6">
14627      Elide deprecated GetThreadStatus.
14628      Bump minor version, subtract 100 from micro version
14629  </change>
14630  <change date="18 Febuary 2004" version="0.3.7">
14631      Document that timer nanosecond values are unsigned.
14632      Clarify text having to do with native methods.
14633  </change>
14634  <change date="19 Febuary 2004" version="0.3.8">
14635      Fix typos.
14636      Remove elided deprecated GetThreadStatus.
14637  </change>
14638  <change date="23 Febuary 2004" version="0.3.9">
14639      Require NotifyFramePop to act on suspended threads.
14640  </change>
14641  <change date="24 Febuary 2004" version="0.3.10">
14642      Add capabilities
14643        (<internallink id="jvmtiCapabilities.can_redefine_any_class"
14644         ><code>can_redefine_any_class</code></internallink>
14645      and
14646         <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events"
14647         ><code>can_generate_all_class_hook_events</code></internallink>)
14648      and an error (<errorlink id="JVMTI_ERROR_UNMODIFIABLE_CLASS"></errorlink>)
14649      which allow some classes to be unmodifiable.
14650  </change>
14651  <change date="28 Febuary 2004" version="0.3.11">
14652      Add JVMTI_ERROR_MUST_POSSESS_CAPABILITY to SetEventNotificationMode.
14653  </change>
14654  <change date="8 March 2004" version="0.3.12">
14655      Clarified CompiledMethodUnload so that it is clear the event
14656      may be posted after the class has been unloaded.
14657  </change>
14658  <change date="5 March 2004" version="0.3.13">
14659      Change the size parameter of VMObjectAlloc to jlong to match GetObjectSize.
14660  </change>
14661  <change date="13 March 2004" version="0.3.14">
14662      Added guideline for the use of the JNI FindClass function in event
14663      callback functions.
14664  </change>
14665  <change date="15 March 2004" version="0.3.15">
14666      Add GetAllStackTraces and GetThreadListStackTraces.
14667  </change>
14668  <change date="19 March 2004" version="0.3.16">
14669      ClassLoad and ClassPrepare events can be posted during start phase.
14670  </change>
14671  <change date="25 March 2004" version="0.3.17">
14672      Add JVMTI_ERROR_NATIVE_METHOD to GetLineNumberTable, GetLocalVariableTable,
14673      GetMaxLocals, GetArgumentsSize, GetMethodLocation, GetBytecodes.
14674  </change>
14675  <change date="29 March 2004" version="0.3.18">
14676      Return the timer kind in the timer information structure.
14677  </change>
14678  <change date="31 March 2004" version="0.3.19">
14679      Spec clarifications:
14680      JVMTI_THREAD_STATE_IN_NATIVE might not include JNI or <jvmti/>.
14681      ForceGarbageCollection does not run finalizers.
14682      The context of the specification is the Java platform.
14683      Warn about early instrumentation.
14684  </change>
14685  <change date="1 April 2004" version="0.3.20">
14686      Refinements to the above clarifications and
14687      Clarify that an error returned by Agent_OnLoad terminates the VM.
14688  </change>
14689  <change date="1 April 2004" version="0.3.21">
14690      Array class creation does not generate a class load event.
14691  </change>
14692  <change date="7 April 2004" version="0.3.22">
14693      Align thread state hierarchy more closely with java.lang.Thread.State.
14694  </change>
14695  <change date="12 April 2004" version="0.3.23">
14696      Clarify the documentation of thread state.
14697  </change>
14698  <change date="19 April 2004" version="0.3.24">
14699      Remove GarbageCollectionOccurred event -- can be done by agent.
14700  </change>
14701  <change date="22 April 2004" version="0.3.25">
14702      Define "command-line option".
14703  </change>
14704  <change date="29 April 2004" version="0.3.26">
14705      Describe the intended use of bytecode instrumentation.
14706      Fix description of extension event first parameter.
14707  </change>
14708  <change date="30 April 2004" version="0.3.27">
14709      Clarification and typos.
14710  </change>
14711  <change date="18 May 2004" version="0.3.28">
14712      Remove DataDumpRequest event.
14713  </change>
14714  <change date="18 May 2004" version="0.3.29">
14715      Clarify RawMonitorWait with zero timeout.
14716      Clarify thread state after RunAgentThread.
14717  </change>
14718  <change date="24 May 2004" version="0.3.30">
14719      Clean-up: fix bad/old links, etc.
14720  </change>
14721  <change date="30 May 2004" version="0.3.31">
14722      Clarifications including:
14723      All character strings are modified UTF-8.
14724      Agent thread visibiity.
14725      Meaning of obsolete method version.
14726      Thread invoking heap callbacks,
14727  </change>
14728  <change date="1 June 2004" version="1.0.32">
14729      Bump major.minor version numbers to "1.0".
14730  </change>
14731  <change date="2 June 2004" version="1.0.33">
14732      Clarify interaction between ForceGarbageCollection
14733      and ObjectFree.
14734  </change>
14735  <change date="6 June 2004" version="1.0.34">
14736      Restrict AddToBootstrapClassLoaderSearch and
14737      SetSystemProperty to the OnLoad phase only.
14738  </change>
14739  <change date="11 June 2004" version="1.0.35">
14740      Fix typo in SetTag.
14741  </change>
14742  <change date="18 June 2004" version="1.0.36">
14743      Fix trademarks.
14744      Add missing parameter in example GetThreadState usage.
14745  </change>
14746  <change date="4 August 2004" version="1.0.37">
14747      Copyright updates.
14748  </change>
14749  <change date="5 November 2004" version="1.0.38">
14750      Add missing function table layout.
14751      Add missing description of C++ member function format of functions.
14752      Clarify that name in CFLH can be NULL.
14753      Released as part of <tm>J2SE</tm> 5.0.
14754  </change>
14755  <change date="24 April 2005" version="1.1.47">
14756      Bump major.minor version numbers to "1.1".
14757      Add ForceEarlyReturn* functions.
14758      Add GetOwnedMonitorStackDepthInfo function.
14759      Add GetCurrentThread function.
14760      Add "since" version marker.
14761      Add AddToSystemClassLoaderSearch.
14762      Allow AddToBootstrapClassLoaderSearch be used in live phase.
14763      Fix historic rubbish in the descriptions of the heap_object_callback
14764      parameter of IterateOverHeap and IterateOverInstancesOfClass functions;
14765      disallow NULL for this parameter.
14766      Clarify, correct and make consistent: wording about current thread,
14767      opaque frames and insufficient number of frames in PopFrame.
14768      Consistently use "current frame" rather than "topmost".
14769      Clarify the JVMTI_ERROR_TYPE_MISMATCH errors in GetLocal* and SetLocal*
14770      by making them compatible with those in ForceEarlyReturn*.
14771      Many other clarifications and wording clean ups.
14772  </change>
14773  <change date="25 April 2005" version="1.1.48">
14774      Add GetConstantPool.
14775      Switch references to the first edition of the VM Spec, to the seconds edition.
14776  </change>
14777  <change date="26 April 2005" version="1.1.49">
14778      Clarify minor/major version order in GetConstantPool.
14779  </change>
14780  <change date="26 April 2005" version="1.1.50">
14781      Add SetNativeMethodPrefix and SetNativeMethodPrefixes.
14782      Reassign GetOwnedMonitorStackDepthInfo to position 153.
14783      Break out Class Loader Search in its own documentation category.
14784      Deal with overly long lines in XML source.
14785  </change>
14786  <change date="29 April 2005" version="1.1.51">
14787      Allow agents be started in the live phase.
14788      Added paragraph about deploying agents.
14789  </change>
14790  <change date="30 April 2005" version="1.1.52">
14791      Add specification description to SetNativeMethodPrefix(es).
14792      Better define the conditions on GetConstantPool.
14793  </change>
14794  <change date="30 April 2005" version="1.1.53">
14795      Break out the GetClassVersionNumber function from GetConstantPool.
14796      Clean-up the references to the VM Spec.
14797  </change>
14798  <change date="1 May 2005" version="1.1.54">
14799      Allow SetNativeMethodPrefix(es) in any phase.
14800      Add clarifications about the impact of redefinition on GetConstantPool.
14801  </change>
14802  <change date="2 May 2005" version="1.1.56">
14803      Various clarifications to SetNativeMethodPrefix(es).
14804  </change>
14805  <change date="2 May 2005" version="1.1.57">
14806      Add missing performance warning to the method entry event.
14807  </change>
14808  <change date="5 May 2005" version="1.1.58">
14809      Remove internal JVMDI support.
14810  </change>
14811  <change date="8 May 2005" version="1.1.59">
14812      Add <functionlink id="RetransformClasses"/>.
14813      Revamp the bytecode instrumentation documentation.
14814      Change <functionlink id="IsMethodObsolete"/> to no longer
14815      require the can_redefine_classes capability.
14816  </change>
14817  <change date="11 May 2005" version="1.1.63">
14818      Clarifications for retransformation.
14819  </change>
14820  <change date="11 May 2005" version="1.1.64">
14821      Clarifications for retransformation, per review.
14822      Lock "retransformation (in)capable" at class load enable time.
14823  </change>
14824  <change date="4 June 2005" version="1.1.67">
14825      Add new heap functionity which supports reporting primitive values,
14826      allows setting the referrer tag, and has more powerful filtering:
14827      FollowReferences, IterateThroughHeap, and their associated
14828      callbacks, structs, enums, and constants.
14829  </change>
14830  <change date="4 June 2005" version="1.1.68">
14831      Clarification.
14832  </change>
14833  <change date="6 June 2005" version="1.1.69">
14834      FollowReferences, IterateThroughHeap: Put callbacks in a struct;
14835      Add missing error codes; reduce bits in the visit control flags.
14836  </change>
14837  <change date="14 June 2005" version="1.1.70">
14838      More on new heap functionity: spec clean-up per review.
14839  </change>
14840  <change date="15 June 2005" version="1.1.71">
14841      More on new heap functionity: Rename old heap section to Heap (1.0).
14842  </change>
14843  <change date="21 June 2005" version="1.1.72">
14844      Fix typos.
14845  </change>
14846  <change date="27 June 2005" version="1.1.73">
14847      Make referrer info structure a union.
14848  </change>
14849  <change date="9 September 2005" version="1.1.74">
14850      In new heap functions:
14851      Add missing superclass reference kind.
14852      Use a single scheme for computing field indexes.
14853      Remove outdated references to struct based referrer info.
14854  </change>
14855  <change date="12 September 2005" version="1.1.75">
14856      Don't callback during FollowReferences on frivolous java.lang.Object superclass.
14857  </change>
14858  <change date="13 September 2005" version="1.1.76">
14859      In string primitive callback, length now Unicode length.
14860      In array and string primitive callbacks, value now "const".
14861      Note possible compiler impacts on setting JNI function table.
14862  </change>
14863  <change date="13 September 2005" version="1.1.77">
14864      GetClassVersionNumbers() and GetConstantPool() should return
14865      error on array or primitive class.
14866  </change>
14867  <change date="14 September 2005" version="1.1.78">
14868      Grammar fixes.
14869  </change>
14870  <change date="26 September 2005" version="1.1.79">
14871      Add IsModifiableClass query.
14872  </change>
14873  <change date="9 February 2006" version="1.1.81">
14874      Add referrer_class_tag parameter to jvmtiHeapReferenceCallback.
14875  </change>
14876  <change date="13 February 2006" version="1.1.82">
14877      Doc fixes: update can_redefine_any_class to include retransform.
14878      Clarify that exception events cover all Throwables.
14879      In GetStackTrace, no test is done for start_depth too big if start_depth is zero,
14880      Clarify fields reported in Primitive Field Callback -- static vs instance.
14881      Repair confusing names of heap types, including callback names.
14882      Require consistent usage of stack depth in the face of thread launch methods.
14883      Note incompatibility of <jvmti/> memory management with other systems.
14884  </change>
14885  <change date="14 February 2006" version="1.1.85">
14886      Fix typos and missing renames.
14887  </change>
14888  <change date="13 March 2006" version="1.1.86">
14889      Clarify that jmethodIDs and jfieldIDs can be saved.
14890      Clarify that Iterate Over Instances Of Class includes subclasses.
14891  </change>
14892  <change date="14 March 2006" version="1.1.87">
14893      Better phrasing.
14894  </change>
14895  <change date="16 March 2006" version="1.1.88">
14896      Match the referrer_index for static fields in Object Reference Callback
14897      with the Reference Implementation (and all other known implementations);
14898      that is, make it match the definition for instance fields.
14899      In GetThreadListStackTraces, add JVMTI_ERROR_INVALID_THREAD to cover
14900      an invalid thread in the list; and specify that not started threads
14901      return empty stacks.
14902  </change>
14903  <change date="17 March 2006" version="1.1.89">
14904      Typo.
14905  </change>
14906  <change date="25 March 2006" version="1.1.90">
14907      Typo.
14908  </change>
14909  <change date="6 April 2006" version="1.1.91">
14910      Remove restrictions on AddToBootstrapClassLoaderSearch and
14911      AddToSystemClassLoaderSearch.
14912  </change>
14913  <change date="1 May 2006" version="1.1.93">
14914      Changed spec to return -1 for monitor stack depth for the
14915      implementation which can not determine stack depth.
14916  </change>
14917  <change date="3 May 2006" version="1.1.94">
14918      Corrections for readability and accuracy courtesy of Alan Pratt of IBM.
14919      List the object relationships reported in FollowReferences.
14920  </change>
14921  <change date="5 May 2006" version="1.1.95">
14922      Clarify the object relationships reported in FollowReferences.
14923  </change>
14924  <change date="28 June 2006" version="1.1.98">
14925      Clarify DisposeEnvironment; add warning.
14926      Fix typos in SetLocalXXX "retrieve" => "set".
14927      Clarify that native method prefixes must remain set while used.
14928      Clarify that exactly one Agent_OnXXX is called per agent.
14929      Clarify that library loading is independent from start-up.
14930      Remove ambiguous reference to Agent_OnLoad in the Agent_OnUnload spec.
14931  </change>
14932  <change date="31 July 2006" version="1.1.99">
14933      Clarify the interaction between functions and exceptions.
14934      Clarify and give examples of field indices.
14935      Remove confusing "That is" sentence from MonitorWait and MonitorWaited events.
14936      Update links to point to Java 6.
14937  </change>
14938  <change date="6 August 2006" version="1.1.102">
14939      Add ResourceExhaustedEvent.
14940  </change>
14941  <change date="11 October 2012" version="1.2.2">
14942      Fixed the "HTTP" and "Missing Anchor" errors reported by the LinkCheck tool.
14943  </change>
14944  <change date="19 June 2013" version="1.2.3">
14945      Added support for statically linked agents.
14946  </change>
14947  <change date="13 October 2016" version="9.0.0">
14948      Support for modules:
14949       - The majorversion is 9 now
14950       - The ClassFileLoadHook events are not sent during the primordial phase anymore.
14951       - Allow CompiledMethodLoad events at start phase
14952       - Add new capabilities:
14953          - can_generate_early_vmstart
14954          - can_generate_early_class_hook_events
14955       - Add new functions:
14956          - GetAllModules
14957          - AddModuleReads, AddModuleExports, AddModuleOpens, AddModuleUses, AddModuleProvides
14958          - IsModifiableModule
14959      Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to
14960      disallow some implementation defined classes.
14961  </change>
14962  <change date="12 February 2017" version="9.0.0">
14963      Minor update for GetCurrentThread function:
14964       - The function may return NULL in the start phase if the
14965         can_generate_early_vmstart capability is enabled.
14966  </change>
14967  <change date="7 February 2018" version="11.0.0">
14968      Minor update for new class file NestHost and NestMembers attributes:
14969        - Specify that RedefineClasses and RetransformClasses are not allowed
14970          to change the class file NestHost and NestMembers attributes.
14971        - Add new error JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED
14972          that can be returned by RedefineClasses and RetransformClasses.
14973  </change>
14974</changehistory>
14975
14976</specification>
14977<!-- Keep this comment at the end of the file
14978Local variables:
14979mode: sgml
14980sgml-omittag:t
14981sgml-shorttag:t
14982sgml-namecase-general:t
14983sgml-general-insert-case:lower
14984sgml-minimize-attributes:nil
14985sgml-always-quote-attributes:t
14986sgml-indent-step:2
14987sgml-indent-data:t
14988sgml-parent-document:nil
14989sgml-exposed-tags:nil
14990sgml-local-catalogs:nil
14991sgml-local-ecat-files:nil
14992End:
14993-->
14994