mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
7019165: Incorrect symbols in pstack output after SymbolTable changes
And out lsb which is set for symbols in constant pool slots to distinguish them from strings Reviewed-by: phh, dholmes, never, dcubed
This commit is contained in:
parent
7c14db880f
commit
c912c29690
1 changed files with 3 additions and 0 deletions
|
@ -524,6 +524,8 @@ name_for_methodOop(jvm_agent_t* J, uint64_t methodOopPtr, char * result, size_t
|
||||||
CHECK_FAIL(err);
|
CHECK_FAIL(err);
|
||||||
err = read_pointer(J, constantPool + nameIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &nameSymbol);
|
err = read_pointer(J, constantPool + nameIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &nameSymbol);
|
||||||
CHECK_FAIL(err);
|
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);
|
err = ps_pread(J->P, nameSymbol + OFFSET_Symbol_length, &nameSymbolLength, 2);
|
||||||
CHECK_FAIL(err);
|
CHECK_FAIL(err);
|
||||||
nameString = (char*)calloc(nameSymbolLength + 1, 1);
|
nameString = (char*)calloc(nameSymbolLength + 1, 1);
|
||||||
|
@ -535,6 +537,7 @@ name_for_methodOop(jvm_agent_t* J, uint64_t methodOopPtr, char * result, size_t
|
||||||
CHECK_FAIL(err);
|
CHECK_FAIL(err);
|
||||||
err = read_pointer(J, constantPool + signatureIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &signatureSymbol);
|
err = read_pointer(J, constantPool + signatureIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &signatureSymbol);
|
||||||
CHECK_FAIL(err);
|
CHECK_FAIL(err);
|
||||||
|
signatureSymbol &= (~1); // remove metadata lsb
|
||||||
err = ps_pread(J->P, signatureSymbol + OFFSET_Symbol_length, &signatureSymbolLength, 2);
|
err = ps_pread(J->P, signatureSymbol + OFFSET_Symbol_length, &signatureSymbolLength, 2);
|
||||||
CHECK_FAIL(err);
|
CHECK_FAIL(err);
|
||||||
signatureString = (char*)calloc(signatureSymbolLength + 1, 1);
|
signatureString = (char*)calloc(signatureSymbolLength + 1, 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue