< prev index next >

src/hotspot/share/runtime/os.cpp

Print this page
rev 58071 : imported patch v1


1097     if (JNIHandles::is_local_handle((jobject) addr)) {
1098       st->print_cr(INTPTR_FORMAT " is a local jni handle", p2i(addr));
1099       return;
1100     }
1101 #endif
1102   }
1103 
1104   // Check if addr belongs to a Java thread.
1105   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
1106     // If the addr is a java thread print information about that.
1107     if (addr == (address)thread) {
1108       if (verbose) {
1109         thread->print_on(st);
1110       } else {
1111         st->print_cr(INTPTR_FORMAT " is a thread", p2i(addr));
1112       }
1113       return;
1114     }
1115     // If the addr is in the stack region for this thread then report that
1116     // and print thread info
1117     if (thread->on_local_stack(addr)) {
1118       st->print_cr(INTPTR_FORMAT " is pointing into the stack for thread: "
1119                    INTPTR_FORMAT, p2i(addr), p2i(thread));
1120       if (verbose) thread->print_on(st);
1121       return;
1122     }
1123   }
1124 
1125   // Check if in metaspace and print types that have vptrs
1126   if (Metaspace::contains(addr)) {
1127     if (Klass::is_valid((Klass*)addr)) {
1128       st->print_cr(INTPTR_FORMAT " is a pointer to class: ", p2i(addr));
1129       ((Klass*)addr)->print_on(st);
1130     } else if (Method::is_valid_method((const Method*)addr)) {
1131       ((Method*)addr)->print_value_on(st);
1132       st->cr();
1133     } else {
1134       // Use addr->print() from the debugger instead (not here)
1135       st->print_cr(INTPTR_FORMAT " is pointing into metadata", p2i(addr));
1136     }
1137     return;




1097     if (JNIHandles::is_local_handle((jobject) addr)) {
1098       st->print_cr(INTPTR_FORMAT " is a local jni handle", p2i(addr));
1099       return;
1100     }
1101 #endif
1102   }
1103 
1104   // Check if addr belongs to a Java thread.
1105   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
1106     // If the addr is a java thread print information about that.
1107     if (addr == (address)thread) {
1108       if (verbose) {
1109         thread->print_on(st);
1110       } else {
1111         st->print_cr(INTPTR_FORMAT " is a thread", p2i(addr));
1112       }
1113       return;
1114     }
1115     // If the addr is in the stack region for this thread then report that
1116     // and print thread info
1117     if (thread->is_in_full_stack(addr)) {
1118       st->print_cr(INTPTR_FORMAT " is pointing into the stack for thread: "
1119                    INTPTR_FORMAT, p2i(addr), p2i(thread));
1120       if (verbose) thread->print_on(st);
1121       return;
1122     }
1123   }
1124 
1125   // Check if in metaspace and print types that have vptrs
1126   if (Metaspace::contains(addr)) {
1127     if (Klass::is_valid((Klass*)addr)) {
1128       st->print_cr(INTPTR_FORMAT " is a pointer to class: ", p2i(addr));
1129       ((Klass*)addr)->print_on(st);
1130     } else if (Method::is_valid_method((const Method*)addr)) {
1131       ((Method*)addr)->print_value_on(st);
1132       st->cr();
1133     } else {
1134       // Use addr->print() from the debugger instead (not here)
1135       st->print_cr(INTPTR_FORMAT " is pointing into metadata", p2i(addr));
1136     }
1137     return;


< prev index next >