< prev index next >

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

Print this page

        

@@ -129,12 +129,19 @@
                          CodeCache c = VM.getVM().getCodeCache();
                          if (c.contains(pc)) {
                             CodeBlob cb = c.findBlobUnsafe(pc);
                             if (cb.isNMethod()) {
                                names = getJavaNames(th, f.localVariableBase());
+                               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 if (names == null || names.length == 0) {
                                // 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()) {
< prev index next >