RFR: 8292921: Rewrite object field printer [v3]
Stefan Karlsson
stefank at openjdk.org
Fri Aug 26 08:45:12 UTC 2022
On Fri, 26 Aug 2022 08:39:21 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> src/hotspot/share/runtime/fieldDescriptor.cpp line 227:
>>
>>> 225: } else {
>>> 226: switch (ft) {
>>> 227: case T_BYTE: st->print(" (" PTR8_FORMAT ")", obj->byte_field(offset())); break;
>>
>> Suggestion: INT8_FORMAT_X as this is not a PTR
>>
>> Ditto for 16, 32, and 64.
>
> I had the same thought first. However, if I use the INT/UINT versions that the output will be: `80041dc0` instead of `0x0000000080041dc0`. I prefer the latter, and that is probably a personal taste, but it also makes it a little less tedious to use in a debugger if 0x is already prepended.
Maybe we can find a better name, that still prints the 0x00<...> format? I agree that these PTR32, PTR16, PTR8 is oddly named. Let me think about alternative names.
-------------
PR: https://git.openjdk.org/jdk/pull/10028
More information about the hotspot-dev
mailing list