RFR: 8375534: Debug method 'pp' should support compressed oops [v2]

Paul Hübner phubner at openjdk.org
Wed Jan 21 08:43:14 UTC 2026


On Mon, 19 Jan 2026 08:11:00 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> The debug method `pp` is currently not able to handle compressed oops. This should fix it. The code is similar to `BlockLocationPrinter<CollectedHeapT>::print_location`.
>> 
>> **Before:**
>> 
>> 
>> (rr) call (void*) pp(0x6b9c08fc8)
>> 
>> "Executing pp"
>> java.lang.Runtime$Version 
>> {0x00000006b9c08fc8} - klass: 'java/lang/Runtime$Version' - flags: 
>> 
>>  - ---- fields (total size 4 words):
>>  - private final value 'version' 'Ljava/util/List;' @12  a 'java/util/ImmutableCollections$List12'{0x00000006b9c2cbb8} (0xd7385977)
>>  - private final value 'pre' 'Ljava/util/Optional;' @16  a 'java/util/Optional'{0x00000006b9c2cbd0} (0xd738597a)
>>  - private final value 'build' 'Ljava/util/Optional;' @20  a 'java/util/Optional'{0x00000006b9c0a118} (0xd7381423)
>>  - private final value 'optional' 'Ljava/util/Optional;' @24  a 'java/util/Optional'{0x00000006b9c2cbe8} (0xd738597d)
>> $1 = (void *) 0x0
>> (rr) call (void*) pp(0xd7381423)
>> 
>> "Executing pp"
>> The program being debugged received signal SIGSEGV, Segmentation fault
>> while in a function called from GDB.  GDB has restored the context
>> to what it was before the call.  To change this behavior use
>> "set unwind-on-signal off".  Evaluation of the expression containing
>> the function (pp(long)) will be abandoned.
>> 
>> 
>> **After:**
>> ```(rr) call (void*) pp(0x6b9c08fc8)
>> 
>> "Executing pp"
>> java.lang.Runtime$Version 
>> {0x00000006b9c08fc8} - klass: 'java/lang/Runtime$Version' - flags: 
>> 
>>  - ---- fields (total size 4 words):
>>  - private final value 'version' 'Ljava/util/List;' @12  a 'java/util/ImmutableCollections$List12'{0x00000006b9c2cbb8} (0xd7385977)
>>  - private final value 'pre' 'Ljava/util/Optional;' @16  a 'java/util/Optional'{0x00000006b9c2cbd0} (0xd738597a)
>>  - private final value 'build' 'Ljava/util/Optional;' @20  a 'java/util/Optional'{0x00000006b9c0a118} (0xd7381423)
>>  - private final value 'optional' 'Ljava/util/Optional;' @24  a 'java/util/Optional'{0x00000006b9c2cbe8} (0xd738597d)
>> $1 = (void *) 0x0
>> (rr) call (void*) pp(0xd7381423)
>> 
>> "Executing pp"
>> 3610776611 is a compressed pointer to object: java.util.Optional 
>> {0x00000006b9c0a118} - klass: 'java/util/Optional' - flags: 
>> 
>>  - ---- fields (total size 3 words):
>>  - private final value 'value' 'Ljava/lang/Object;' @16  null (0x00000000)
>> $2 = (void *) 0x0
>> 
>> 
>> Thanks,
>> Tobias
>
> Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Let's just use print_location instead

Marked as reviewed by phubner (Author).

-------------

PR Review: https://git.openjdk.org/jdk/pull/29280#pullrequestreview-3685960019


More information about the hotspot-dev mailing list