7019165: Incorrect symbols in pstack output after SymbolTable changes
authorcoleenp
Wed, 16 Mar 2011 14:57:49 -0400
changeset 8663 47d64a4e510e
parent 8662 6d4f3724c1e6
child 8666 79842ef31d49
7019165: Incorrect symbols in pstack output after SymbolTable changes Summary: And out lsb which is set for symbols in constant pool slots to distinguish them from strings Reviewed-by: phh, dholmes, never, dcubed
hotspot/src/os/solaris/dtrace/libjvm_db.c
--- a/hotspot/src/os/solaris/dtrace/libjvm_db.c	Tue Mar 15 06:50:01 2011 -0700
+++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c	Wed Mar 16 14:57:49 2011 -0400
@@ -524,6 +524,8 @@
   CHECK_FAIL(err);
   err = read_pointer(J, constantPool + nameIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &nameSymbol);
   CHECK_FAIL(err);
+  // The symbol is a CPSlot and has lower bit set to indicate metadata
+  nameSymbol &= (~1); // remove metadata lsb
   err = ps_pread(J->P, nameSymbol + OFFSET_Symbol_length, &nameSymbolLength, 2);
   CHECK_FAIL(err);
   nameString = (char*)calloc(nameSymbolLength + 1, 1);
@@ -535,6 +537,7 @@
   CHECK_FAIL(err);
   err = read_pointer(J, constantPool + signatureIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &signatureSymbol);
   CHECK_FAIL(err);
+  signatureSymbol &= (~1);  // remove metadata lsb
   err = ps_pread(J->P, signatureSymbol + OFFSET_Symbol_length, &signatureSymbolLength, 2);
   CHECK_FAIL(err);
   signatureString = (char*)calloc(signatureSymbolLength + 1, 1);