1/*
2 Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
3 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
5 This code is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License version 2 only, as
7 published by the Free Software Foundation.
8
9 This code is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 version 2 for more details (a copy is included in the LICENSE file that
13 accompanied this code).
14
15 You should have received a copy of the GNU General Public License version
16 2 along with this work; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
19 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 or visit www.oracle.com if you need additional information or have any
21 questions.
22 */
23
24 /* AUTOMATICALLY GENERATED FILE - DO NOT EDIT */
25
26
27
28#ifndef GENERATED_JVMTIFILES_JVMTIENV_HPP
29#define GENERATED_JVMTIFILES_JVMTIENV_HPP
30
31#include "prims/jvmtiEnvBase.hpp"
32#include "prims/jvmtiImpl.hpp"
33
34enum {
35 JVMTI_INTERNAL_CAPABILITY_COUNT = 44
36};
37
38
39class JvmtiEnv : public JvmtiEnvBase {
40
41private:
42
43 JvmtiEnv(jint version);
44 ~JvmtiEnv();
45
46public:
47
48 static JvmtiEnv* create_a_jvmti(jint version);
49
50
51 // Memory Management functions
52 jvmtiError Allocate(jlong size, unsigned char** mem_ptr);
53 jvmtiError Deallocate(unsigned char* mem);
54
55 // Thread functions
56 jvmtiError GetThreadState(jthread thread, jint* thread_state_ptr);
57 jvmtiError GetCurrentThread(jthread* thread_ptr);
58 jvmtiError GetAllThreads(jint* threads_count_ptr, jthread** threads_ptr);
59 jvmtiError SuspendThread(JavaThread* java_thread);
60 jvmtiError SuspendThreadList(jint request_count, const jthread* request_list, jvmtiError* results);
61 jvmtiError ResumeThread(JavaThread* java_thread);
62 jvmtiError ResumeThreadList(jint request_count, const jthread* request_list, jvmtiError* results);
63 jvmtiError StopThread(JavaThread* java_thread, jobject exception);
64 jvmtiError InterruptThread(jthread thread);
65 jvmtiError GetThreadInfo(jthread thread, jvmtiThreadInfo* info_ptr);
66 jvmtiError GetOwnedMonitorInfo(JavaThread* java_thread, jint* owned_monitor_count_ptr, jobject** owned_monitors_ptr);
67 jvmtiError GetOwnedMonitorStackDepthInfo(JavaThread* java_thread, jint* monitor_info_count_ptr, jvmtiMonitorStackDepthInfo** monitor_info_ptr);
68 jvmtiError GetCurrentContendedMonitor(JavaThread* java_thread, jobject* monitor_ptr);
69 jvmtiError RunAgentThread(jthread thread, jvmtiStartFunction proc, const void* arg, jint priority);
70 jvmtiError SetThreadLocalStorage(JavaThread* java_thread, const void* data);
71 jvmtiError GetThreadLocalStorage(jthread thread, void** data_ptr);
72
73 // Thread Group functions
74 jvmtiError GetTopThreadGroups(jint* group_count_ptr, jthreadGroup** groups_ptr);
75 jvmtiError GetThreadGroupInfo(jthreadGroup group, jvmtiThreadGroupInfo* info_ptr);
76 jvmtiError GetThreadGroupChildren(jthreadGroup group, jint* thread_count_ptr, jthread** threads_ptr, jint* group_count_ptr, jthreadGroup** groups_ptr);
77
78 // Stack Frame functions
79 jvmtiError GetStackTrace(JavaThread* java_thread, jint start_depth, jint max_frame_count, jvmtiFrameInfo* frame_buffer, jint* count_ptr);
80 jvmtiError GetAllStackTraces(jint max_frame_count, jvmtiStackInfo** stack_info_ptr, jint* thread_count_ptr);
81 jvmtiError GetThreadListStackTraces(jint thread_count, const jthread* thread_list, jint max_frame_count, jvmtiStackInfo** stack_info_ptr);
82 jvmtiError GetFrameCount(JavaThread* java_thread, jint* count_ptr);
83 jvmtiError PopFrame(JavaThread* java_thread);
84 jvmtiError GetFrameLocation(JavaThread* java_thread, jint depth, jmethodID* method_ptr, jlocation* location_ptr);
85 jvmtiError NotifyFramePop(JavaThread* java_thread, jint depth);
86
87 // Force Early Return functions
88 jvmtiError ForceEarlyReturnObject(JavaThread* java_thread, jobject value);
89 jvmtiError ForceEarlyReturnInt(JavaThread* java_thread, jint value);
90 jvmtiError ForceEarlyReturnLong(JavaThread* java_thread, jlong value);
91 jvmtiError ForceEarlyReturnFloat(JavaThread* java_thread, jfloat value);
92 jvmtiError ForceEarlyReturnDouble(JavaThread* java_thread, jdouble value);
93 jvmtiError ForceEarlyReturnVoid(JavaThread* java_thread);
94
95 // Heap functions
96 jvmtiError FollowReferences(jint heap_filter, jclass klass, jobject initial_object, const jvmtiHeapCallbacks* callbacks, const void* user_data);
97 jvmtiError IterateThroughHeap(jint heap_filter, jclass klass, const jvmtiHeapCallbacks* callbacks, const void* user_data);
98 jvmtiError GetTag(jobject object, jlong* tag_ptr);
99 jvmtiError SetTag(jobject object, jlong tag);
100 jvmtiError GetObjectsWithTags(jint tag_count, const jlong* tags, jint* count_ptr, jobject** object_result_ptr, jlong** tag_result_ptr);
101 jvmtiError ForceGarbageCollection();
102
103 // Heap (1.0) functions
104 jvmtiError IterateOverObjectsReachableFromObject(jobject object, jvmtiObjectReferenceCallback object_reference_callback, const void* user_data);
105 jvmtiError IterateOverReachableObjects(jvmtiHeapRootCallback heap_root_callback, jvmtiStackReferenceCallback stack_ref_callback, jvmtiObjectReferenceCallback object_ref_callback, const void* user_data);
106 jvmtiError IterateOverHeap(jvmtiHeapObjectFilter object_filter, jvmtiHeapObjectCallback heap_object_callback, const void* user_data);
107 jvmtiError IterateOverInstancesOfClass(oop k_mirror, jvmtiHeapObjectFilter object_filter, jvmtiHeapObjectCallback heap_object_callback, const void* user_data);
108
109 // Local Variable functions
110 jvmtiError GetLocalObject(JavaThread* java_thread, jint depth, jint slot, jobject* value_ptr);
111 jvmtiError GetLocalInstance(JavaThread* java_thread, jint depth, jobject* value_ptr);
112 jvmtiError GetLocalInt(JavaThread* java_thread, jint depth, jint slot, jint* value_ptr);
113 jvmtiError GetLocalLong(JavaThread* java_thread, jint depth, jint slot, jlong* value_ptr);
114 jvmtiError GetLocalFloat(JavaThread* java_thread, jint depth, jint slot, jfloat* value_ptr);
115 jvmtiError GetLocalDouble(JavaThread* java_thread, jint depth, jint slot, jdouble* value_ptr);
116 jvmtiError SetLocalObject(JavaThread* java_thread, jint depth, jint slot, jobject value);
117 jvmtiError SetLocalInt(JavaThread* java_thread, jint depth, jint slot, jint value);
118 jvmtiError SetLocalLong(JavaThread* java_thread, jint depth, jint slot, jlong value);
119 jvmtiError SetLocalFloat(JavaThread* java_thread, jint depth, jint slot, jfloat value);
120 jvmtiError SetLocalDouble(JavaThread* java_thread, jint depth, jint slot, jdouble value);
121
122 // Breakpoint functions
123 jvmtiError SetBreakpoint(Method* method_oop, jlocation location);
124 jvmtiError ClearBreakpoint(Method* method_oop, jlocation location);
125
126 // Watched Field functions
127 jvmtiError SetFieldAccessWatch(fieldDescriptor* fdesc_ptr);
128 jvmtiError ClearFieldAccessWatch(fieldDescriptor* fdesc_ptr);
129 jvmtiError SetFieldModificationWatch(fieldDescriptor* fdesc_ptr);
130 jvmtiError ClearFieldModificationWatch(fieldDescriptor* fdesc_ptr);
131
132 // Module functions
133 jvmtiError GetAllModules(jint* module_count_ptr, jobject** modules_ptr);
134 jvmtiError GetNamedModule(jobject class_loader, const char* package_name, jobject* module_ptr);
135 jvmtiError AddModuleReads(jobject module, jobject to_module);
136 jvmtiError AddModuleExports(jobject module, const char* pkg_name, jobject to_module);
137 jvmtiError AddModuleOpens(jobject module, const char* pkg_name, jobject to_module);
138 jvmtiError AddModuleUses(jobject module, jclass service);
139 jvmtiError AddModuleProvides(jobject module, jclass service, jclass impl_class);
140 jvmtiError IsModifiableModule(jobject module, jboolean* is_modifiable_module_ptr);
141
142 // Class functions
143 jvmtiError GetLoadedClasses(jint* class_count_ptr, jclass** classes_ptr);
144 jvmtiError GetClassLoaderClasses(jobject initiating_loader, jint* class_count_ptr, jclass** classes_ptr);
145 jvmtiError GetClassSignature(oop k_mirror, char** signature_ptr, char** generic_ptr);
146 jvmtiError GetClassStatus(oop k_mirror, jint* status_ptr);
147 jvmtiError GetSourceFileName(oop k_mirror, char** source_name_ptr);
148 jvmtiError GetClassModifiers(oop k_mirror, jint* modifiers_ptr);
149 jvmtiError GetClassMethods(oop k_mirror, jint* method_count_ptr, jmethodID** methods_ptr);
150 jvmtiError GetClassFields(oop k_mirror, jint* field_count_ptr, jfieldID** fields_ptr);
151 jvmtiError GetImplementedInterfaces(oop k_mirror, jint* interface_count_ptr, jclass** interfaces_ptr);
152 jvmtiError GetClassVersionNumbers(oop k_mirror, jint* minor_version_ptr, jint* major_version_ptr);
153 jvmtiError GetConstantPool(oop k_mirror, jint* constant_pool_count_ptr, jint* constant_pool_byte_count_ptr, unsigned char** constant_pool_bytes_ptr);
154 jvmtiError IsInterface(oop k_mirror, jboolean* is_interface_ptr);
155 jvmtiError IsArrayClass(oop k_mirror, jboolean* is_array_class_ptr);
156 jvmtiError IsModifiableClass(oop k_mirror, jboolean* is_modifiable_class_ptr);
157 jvmtiError GetClassLoader(oop k_mirror, jobject* classloader_ptr);
158 jvmtiError GetSourceDebugExtension(oop k_mirror, char** source_debug_extension_ptr);
159 jvmtiError RetransformClasses(jint class_count, const jclass* classes);
160 jvmtiError RedefineClasses(jint class_count, const jvmtiClassDefinition* class_definitions);
161
162 // Object functions
163 jvmtiError GetObjectSize(jobject object, jlong* size_ptr);
164 jvmtiError GetObjectHashCode(jobject object, jint* hash_code_ptr);
165 jvmtiError GetObjectMonitorUsage(jobject object, jvmtiMonitorUsage* info_ptr);
166
167 // Field functions
168 jvmtiError GetFieldName(fieldDescriptor* fdesc_ptr, char** name_ptr, char** signature_ptr, char** generic_ptr);
169 jvmtiError GetFieldDeclaringClass(fieldDescriptor* fdesc_ptr, jclass* declaring_class_ptr);
170 jvmtiError GetFieldModifiers(fieldDescriptor* fdesc_ptr, jint* modifiers_ptr);
171 jvmtiError IsFieldSynthetic(fieldDescriptor* fdesc_ptr, jboolean* is_synthetic_ptr);
172
173 // Method functions
174 jvmtiError GetMethodName(Method* method_oop, char** name_ptr, char** signature_ptr, char** generic_ptr);
175 jvmtiError GetMethodDeclaringClass(Method* method_oop, jclass* declaring_class_ptr);
176 jvmtiError GetMethodModifiers(Method* method_oop, jint* modifiers_ptr);
177 jvmtiError GetMaxLocals(Method* method_oop, jint* max_ptr);
178 jvmtiError GetArgumentsSize(Method* method_oop, jint* size_ptr);
179 jvmtiError GetLineNumberTable(Method* method_oop, jint* entry_count_ptr, jvmtiLineNumberEntry** table_ptr);
180 jvmtiError GetMethodLocation(Method* method_oop, jlocation* start_location_ptr, jlocation* end_location_ptr);
181 jvmtiError GetLocalVariableTable(Method* method_oop, jint* entry_count_ptr, jvmtiLocalVariableEntry** table_ptr);
182 jvmtiError GetBytecodes(Method* method_oop, jint* bytecode_count_ptr, unsigned char** bytecodes_ptr);
183 jvmtiError IsMethodNative(Method* method_oop, jboolean* is_native_ptr);
184 jvmtiError IsMethodSynthetic(Method* method_oop, jboolean* is_synthetic_ptr);
185 jvmtiError IsMethodObsolete(Method* method_oop, jboolean* is_obsolete_ptr);
186 jvmtiError SetNativeMethodPrefix(const char* prefix);
187 jvmtiError SetNativeMethodPrefixes(jint prefix_count, char** prefixes);
188
189 // Raw Monitor functions
190 jvmtiError CreateRawMonitor(const char* name, jrawMonitorID* monitor_ptr);
191 jvmtiError DestroyRawMonitor(JvmtiRawMonitor * rmonitor);
192 jvmtiError RawMonitorEnter(JvmtiRawMonitor * rmonitor);
193 jvmtiError RawMonitorExit(JvmtiRawMonitor * rmonitor);
194 jvmtiError RawMonitorWait(JvmtiRawMonitor * rmonitor, jlong millis);
195 jvmtiError RawMonitorNotify(JvmtiRawMonitor * rmonitor);
196 jvmtiError RawMonitorNotifyAll(JvmtiRawMonitor * rmonitor);
197
198 // JNI Function Interception functions
199 jvmtiError SetJNIFunctionTable(const jniNativeInterface* function_table);
200 jvmtiError GetJNIFunctionTable(jniNativeInterface** function_table);
201
202 // Event Management functions
203 jvmtiError SetEventCallbacks(const jvmtiEventCallbacks* callbacks, jint size_of_callbacks);
204 jvmtiError SetEventNotificationMode(jvmtiEventMode mode, jvmtiEvent event_type, jthread event_thread, ...);
205 jvmtiError GenerateEvents(jvmtiEvent event_type);
206
207 // Extension Mechanism functions
208 jvmtiError GetExtensionFunctions(jint* extension_count_ptr, jvmtiExtensionFunctionInfo** extensions);
209 jvmtiError GetExtensionEvents(jint* extension_count_ptr, jvmtiExtensionEventInfo** extensions);
210 jvmtiError SetExtensionEventCallback(jint extension_event_index, jvmtiExtensionEvent callback);
211
212 // Capability functions
213 jvmtiError GetPotentialCapabilities(jvmtiCapabilities* capabilities_ptr);
214 jvmtiError AddCapabilities(const jvmtiCapabilities* capabilities_ptr);
215 jvmtiError RelinquishCapabilities(const jvmtiCapabilities* capabilities_ptr);
216 jvmtiError GetCapabilities(jvmtiCapabilities* capabilities_ptr);
217
218 // Timers functions
219 jvmtiError GetCurrentThreadCpuTimerInfo(jvmtiTimerInfo* info_ptr);
220 jvmtiError GetCurrentThreadCpuTime(jlong* nanos_ptr);
221 jvmtiError GetThreadCpuTimerInfo(jvmtiTimerInfo* info_ptr);
222 jvmtiError GetThreadCpuTime(JavaThread* java_thread, jlong* nanos_ptr);
223 jvmtiError GetTimerInfo(jvmtiTimerInfo* info_ptr);
224 jvmtiError GetTime(jlong* nanos_ptr);
225 jvmtiError GetAvailableProcessors(jint* processor_count_ptr);
226
227 // Class Loader Search functions
228 jvmtiError AddToBootstrapClassLoaderSearch(const char* segment);
229 jvmtiError AddToSystemClassLoaderSearch(const char* segment);
230
231 // System Properties functions
232 jvmtiError GetSystemProperties(jint* count_ptr, char*** property_ptr);
233 jvmtiError GetSystemProperty(const char* property, char** value_ptr);
234 jvmtiError SetSystemProperty(const char* property, const char* value_ptr);
235
236 // General functions
237 jvmtiError GetPhase(jvmtiPhase* phase_ptr);
238 jvmtiError DisposeEnvironment();
239 jvmtiError SetEnvironmentLocalStorage(const void* data);
240 jvmtiError GetEnvironmentLocalStorage(void** data_ptr);
241 jvmtiError GetVersionNumber(jint* version_ptr);
242 jvmtiError GetErrorName(jvmtiError error, char** name_ptr);
243 jvmtiError SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value);
244 jvmtiError GetJLocationFormat(jvmtiJlocationFormat* format_ptr);
245
246 // Heap Monitoring functions
247 jvmtiError SetHeapSamplingInterval(jint sampling_interval);
248
249};
250
251#endif // GENERATED_JVMTIFILES_JVMTIENV_HPP
252