jvmtiExtensions.cpp revision 0
/*
* Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
# include "incls/_precompiled.incl"
# include "incls/_jvmtiExtensions.cpp.incl"
// the list of extension functions
// the list of extension events
// extension function
return JVMTI_ERROR_NULL_POINTER;
}
return JVMTI_ERROR_NONE;
}
// register extension functions and events. In this implementation we
// have a single extension function (to prove the API) that tests if class
// unloading is enabled or disabled. We also have a single extension event
// EXT_EVENT_CLASS_UNLOAD which is used to provide the JVMDI_EVENT_CLASS_UNLOAD
// event. The function and the event are registered here.
//
void JvmtiExtensions::register_extensions() {
// register our extension function
static jvmtiParamInfo func_params[] = {
};
static jvmtiExtensionFunctionInfo ext_func = {
(char*)"com.sun.hotspot.functions.IsClassUnloadingEnabled",
(char*)"Tell if class unloading is enabled (-noclassgc)",
sizeof(func_params)/sizeof(func_params[0]),
0, // no non-universal errors
};
// register our extension event
static jvmtiParamInfo event_params[] = {
};
static jvmtiExtensionEventInfo ext_event = {
(char*)"com.sun.hotspot.events.ClassUnload",
(char*)"CLASS_UNLOAD event",
sizeof(event_params)/sizeof(event_params[0]),
};
}
// return the list of extension functions
{
sizeof(jvmtiExtensionFunctionInfo),
(unsigned char**)&ext_funcs);
if (err != JVMTI_ERROR_NONE) {
return err;
}
for (int i=0; i<_ext_functions->length(); i++ ) {
if (err != JVMTI_ERROR_NONE) {
return err;
}
(unsigned char**)&(ext_funcs[i].short_description));
if (err != JVMTI_ERROR_NONE) {
return err;
}
// params
if (param_count == 0) {
} else {
if (err != JVMTI_ERROR_NONE) {
return err;
}
for (int j=0; j<param_count; j++) {
(unsigned char**)&(dst_params[j].name));
if (err != JVMTI_ERROR_NONE) {
return err;
}
}
}
// errors
if (error_count == 0) {
} else {
if (err != JVMTI_ERROR_NONE) {
return err;
}
error_count*sizeof(jvmtiError));
}
}
*extensions = ext_funcs;
return JVMTI_ERROR_NONE;
}
// return the list of extension events
{
(unsigned char**)&ext_events);
if (err != JVMTI_ERROR_NONE) {
return err;
}
for (int i=0; i<_ext_events->length(); i++ ) {
if (err != JVMTI_ERROR_NONE) {
return err;
}
(unsigned char**)&(ext_events[i].short_description));
if (err != JVMTI_ERROR_NONE) {
return err;
}
// params
if (param_count == 0) {
} else {
(unsigned char**)&(ext_events[i].params));
if (err != JVMTI_ERROR_NONE) {
return err;
}
for (int j=0; j<param_count; j++) {
(unsigned char**)&(dst_params[j].name));
if (err != JVMTI_ERROR_NONE) {
return err;
}
}
}
}
*extensions = ext_events;
return JVMTI_ERROR_NONE;
}
{
// if there are extension events registered then validate that the
// extension_event_index matches one of the registered events.
if (_ext_events != NULL) {
for (int i=0; i<_ext_events->length(); i++ ) {
break;
}
}
}
// invalid event index
return JVMTI_ERROR_ILLEGAL_ARGUMENT;
}
callback);
return JVMTI_ERROR_NONE;
}