mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-28 20:03:39 +00:00
8282852: Debug agent asserts in classTrack_addPreparedClass()
Reviewed-by: amenkov, lmesnik
This commit is contained in:
parent
7b91bbba82
commit
f5217b475e
@ -110,21 +110,28 @@ classTrack_addPreparedClass(JNIEnv *env_unused, jclass klass)
|
||||
jvmtiError error;
|
||||
jvmtiEnv* env = trackingEnv;
|
||||
|
||||
if (gdata && gdata->assertOn) {
|
||||
// Check this is not already tagged.
|
||||
jlong tag;
|
||||
error = JVMTI_FUNC_PTR(trackingEnv, GetTag)(env, klass, &tag);
|
||||
if (error != JVMTI_ERROR_NONE) {
|
||||
EXIT_ERROR(error, "Unable to GetTag with class trackingEnv");
|
||||
}
|
||||
JDI_ASSERT(tag == NOT_TAGGED);
|
||||
}
|
||||
|
||||
char* signature;
|
||||
error = classSignature(klass, &signature, NULL);
|
||||
if (error != JVMTI_ERROR_NONE) {
|
||||
EXIT_ERROR(error,"signature");
|
||||
}
|
||||
|
||||
if (gdata && gdata->assertOn) {
|
||||
// Check if already tagged.
|
||||
jlong tag;
|
||||
error = JVMTI_FUNC_PTR(trackingEnv, GetTag)(env, klass, &tag);
|
||||
if (error != JVMTI_ERROR_NONE) {
|
||||
EXIT_ERROR(error, "Unable to GetTag with class trackingEnv");
|
||||
}
|
||||
if (tag != NOT_TAGGED) {
|
||||
// If tagged, the old tag better be the same as the new.
|
||||
char* oldSignature = (char*)jlong_to_ptr(tag);
|
||||
JDI_ASSERT(strcmp(signature, oldSignature) == 0);
|
||||
jvmtiDeallocate(signature);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
error = JVMTI_FUNC_PTR(trackingEnv, SetTag)(env, klass, ptr_to_jlong(signature));
|
||||
if (error != JVMTI_ERROR_NONE) {
|
||||
jvmtiDeallocate(signature);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user