< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java

Print this page

        

@@ -128,15 +128,24 @@
                          // look for known code blobs
                          CodeCache c = VM.getVM().getCodeCache();
                          if (c.contains(pc)) {
                             CodeBlob cb = c.findBlobUnsafe(pc);
                             if (cb.isNMethod()) {
+                               if (cb.isNativeMethod()) {
+                                  out.print(((CompiledMethod)cb).getMethod().externalNameAndSignature());
+                                  long diff = pc.minus(cb.codeBegin());
+                                  if (diff != 0L) {
+                                    out.print(" + 0x" + Long.toHexString(diff));
+                                  }
+                                  out.println(" (Native method)");
+                               } else {
                                names = getJavaNames(th, f.localVariableBase());
                                // just print compiled code, if can't determine method
                                if (names == null || names.length == 0) {
                                   out.println("<Unknown compiled code>");
                                }
+                               }
                             } else if (cb.isBufferBlob()) {
                                out.println("<StubRoutines>");
                             } else if (cb.isRuntimeStub()) {
                                out.println("<RuntimeStub>");
                             } else if (cb.isDeoptimizationStub()) {
< prev index next >