[foreign-memaccess+abi] RFR: 8291639: Improve the ability to visualize a MemorySegment in human readable forms [v13]

Roger Riggs rriggs at openjdk.org
Thu Aug 25 15:02:52 UTC 2022


On Wed, 3 Aug 2022 16:28:28 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> I think it is possible to specify the `hexDump()` method in detail and also make it more general so it can be applied to virtually any memory representation such as `byte[]` or `ByteBuffer`.
>
> Yep, I do think that hex dump doesn't really belong here - but should be a common functionality shared between all byte array views.

I worked on a more comprehensive HexPrinter API that was downsized to what became java.util.HexFormat.
The HexPrinter API was sidelined into the test test library: jdk/test/lib/hexdump/HexPrinter.

I agree that support for other memory buffers/segments is desirable as a generalization, even if only to HexFormat but expands the scope beyond Panama (and could be done separately).

A more general human readable formatting/layout capability is typically beyond what's included in JDK APIs. I might look to IntelliJ or the debugger to support the inspection functionality.

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

PR: https://git.openjdk.org/panama-foreign/pull/695


More information about the panama-dev mailing list