summaryrefslogtreecommitdiff
path: root/test/992-source-data/source_file.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/992-source-data/source_file.cc')
-rw-r--r--test/992-source-data/source_file.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/992-source-data/source_file.cc b/test/992-source-data/source_file.cc
index 46d197d048..78687ff005 100644
--- a/test/992-source-data/source_file.cc
+++ b/test/992-source-data/source_file.cc
@@ -49,6 +49,19 @@ jstring JNICALL Java_art_Test992_getSourceFileName(JNIEnv* env,
return ret;
}
+extern "C" JNIEXPORT
+jstring JNICALL Java_art_Test992_getSourceDebugExtension(JNIEnv* env,
+ jclass klass ATTRIBUTE_UNUSED,
+ jclass target) {
+ char* ext = nullptr;
+ if (JvmtiErrorToException(env, jvmti_env, jvmti_env->GetSourceDebugExtension(target, &ext))) {
+ return nullptr;
+ }
+ jstring ret = env->NewStringUTF(ext);
+ jvmti_env->Deallocate(reinterpret_cast<unsigned char*>(ext));
+ return ret;
+}
+
} // namespace Test992SourceFile
} // namespace art