Commit 29f2b468 authored by Lubomir Bulej's avatar Lubomir Bulej

Provide function to get/set object tag

This will be needed to properly support classloader identification
in instrumentation requests.
parent 20f3227a
......@@ -168,6 +168,31 @@ jvmti_get_system_property_string (
}
/**
* Gets tag from the given object. This method can only be called
* during the START and LIVE phases.
*/
jlong
jvmti_get_object_tag (jvmtiEnv * jvmti, jobject object) {
jlong tag;
jvmtiError error = (*jvmti)->GetTag (jvmti, object, &tag);
check_jvmti_error (jvmti, error, "failed to get object tag");
return tag;
}
/**
* Sets a tag to the given object. This method can only be called
* during the START and LIVE phases.
*/
jlong
jvmti_set_object_tag (jvmtiEnv * jvmti, jobject object, jlong tag) {
jvmtiError error = (*jvmti)->SetTag (jvmti, object, tag);
check_jvmti_error (jvmti, error, "failed to set object tag");
return tag;
}
/**
* Reports a JVMTI error and terminates the program. This function implements
* the slow path of check_jvmti_error() and prints the given error message
......
......@@ -26,6 +26,10 @@ char * jvmti_get_system_property_string (
jvmtiEnv * jvmti, const char * name, const char * dflval
);
jlong jvmti_get_object_tag (jvmtiEnv * jvmti, jobject object);
jlong jvmti_set_object_tag (jvmtiEnv * jvmti, jobject object, jlong tag);
//
void die_with_jvmti_error (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment