--- a/hotspot/agent/src/os/solaris/proc/saproc.cpp Thu Aug 28 11:29:09 2014 -0400
+++ b/hotspot/agent/src/os/solaris/proc/saproc.cpp Thu Aug 28 11:30:11 2014 -0400
@@ -90,7 +90,9 @@
*/
static void throwNewDebuggerException(JNIEnv* env, const char* errMsg) {
- env->ThrowNew(env->FindClass("sun/jvm/hotspot/debugger/DebuggerException"), errMsg);
+ jclass clazz = env->FindClass("sun/jvm/hotspot/debugger/DebuggerException");
+ CHECK_EXCEPTION;
+ env->ThrowNew(clazz, errMsg);
}
// JNI ids for some fields, methods
@@ -962,6 +964,7 @@
CHECK_EXCEPTION_(0);
jboolean isCopy;
jlong* ptr = env->GetLongArrayElements(res, &isCopy);
+ CHECK_EXCEPTION_(NULL);
for (int i = 0; i < NPRGREG; i++) {
ptr[i] = (jlong) (uintptr_t) gregs[i];
}
@@ -1253,6 +1256,7 @@
(JNIEnv *env, jobject this_object, jstring name) {
jboolean isCopy;
const char* ptr = env->GetStringUTFChars(name, &isCopy);
+ CHECK_EXCEPTION_(NULL);
char buf[2*SYMBOL_BUF_SIZE + 1];
jstring res = 0;
if (cplus_demangle((char*) ptr, buf, sizeof(buf)) != DEMANGLE_ESPACE) {
@@ -1439,7 +1443,9 @@
"createClosestSymbol", "(Ljava/lang/String;J)Lsun/jvm/hotspot/debugger/cdbg/ClosestSymbol;");
CHECK_EXCEPTION;
- listAdd_ID = env->GetMethodID(env->FindClass("java/util/List"), "add", "(Ljava/lang/Object;)Z");
+ jclass list_clazz = env->FindClass("java/util/List");
+ CHECK_EXCEPTION;
+ listAdd_ID = env->GetMethodID(list_clazz, "add", "(Ljava/lang/Object;)Z");
CHECK_EXCEPTION;
// part of the class sharing workaround
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp Thu Aug 28 11:29:09 2014 -0400
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp Thu Aug 28 11:30:11 2014 -0400
@@ -1678,14 +1678,9 @@
dlclose(handle);
#elif defined(__APPLE__)
- uint32_t count;
- uint32_t i;
-
- count = _dyld_image_count();
- for (i = 1; i < count; i++) {
- const char *name = _dyld_get_image_name(i);
- intptr_t slide = _dyld_get_image_vmaddr_slide(i);
- st->print_cr(PTR_FORMAT " \t%s", slide, name);
+ for (uint32_t i = 1; i < _dyld_image_count(); i++) {
+ st->print_cr(PTR_FORMAT " \t%s", _dyld_get_image_header(i),
+ _dyld_get_image_name(i));
}
#else
st->print_cr("Error: Cannot print dynamic libraries.");