RFR: 8292921: Rewrite object field printer [v3]

Stefan Karlsson stefank at openjdk.org
Fri Aug 26 08:45:11 UTC 2022


On Fri, 26 Aug 2022 01:54:12 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix macOS sensitivity to format specifier for jlong
>
> 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.

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

PR: https://git.openjdk.org/jdk/pull/10028


More information about the hotspot-dev mailing list