RFR: 8375534: Debug method 'pp' should support compressed oops [v2]
Tobias Hartmann
thartmann at openjdk.org
Mon Jan 19 08:11:00 UTC 2026
> 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
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/29280/files
- new: https://git.openjdk.org/jdk/pull/29280/files/d09f09ca..c4b67195
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=29280&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=29280&range=00-01
Stats: 18 lines in 1 file changed: 1 ins; 17 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/29280.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/29280/head:pull/29280
PR: https://git.openjdk.org/jdk/pull/29280
More information about the hotspot-dev
mailing list