<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>I agree that functionalities like these are useful.</p>
    <p>IIRC, there were a bunch of design questions - such as, whether
      to make this functionalities available only for memory segments,
      or also for byte buffer, and as to whether customization was
      required (especially for the hexdump format).</p>
    <p>IMHO, the most interesting (and Panama related) part is this
      (e.g. memory inspection):</p>
    <p><a class="moz-txt-link-freetext" href="https://github.com/openjdk/panama-foreign/pull/715/files">https://github.com/openjdk/panama-foreign/pull/715/files</a></p>
    <p>Which allows to dump the contents of a memory segment using a
      memory layout (with some names attached). This allows to render
      structs and unions with ease, and it amounts at a single extra
      method on memory segment (or, from the other side, on memory
      layout).<br>
    </p>
    <p>The HexDump functionality is, IMHO, more general, and I believe
      it deserves a more central place in the JDK, rather than some
      class in java.lang.foreign. In principle, users might want to
      produce hexdumps of byte buffers, segments, byte arrays,
      Collection<Byte>, ...</p>
    <p>(as I write this, I realize that the same argument might be
      applied to the memory inspection stuff, but I think it's a
      defensible move to keep layouts and segments together, which we
      have done in other places).</p>
    <p>Which of the two pieces of functionalities you find yourselves
      more in need of? Memory inspection (e.g. segment + layout ->
      string), or hexdump? Or both?</p>
    <p>Cheers<br>
      Maurizio<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 23/01/2023 10:01, Johannes
      Lichtenberger wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CAGXNUvZ25M27O396SeYsOP0jrOS7oRFiN_A9qGiCXxEk8E95ug@mail.gmail.com">
      
      <div dir="ltr">Wow, this would be immensely useful to debug stuff,
        IMHO...
        <div><br>
        </div>
        <div>kind regards</div>
        <div>Johannes</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">Am Sa., 21. Jan. 2023 um
          22:07 Uhr schrieb Gavin Ray <<a href="mailto:ray.gavin97@gmail.com" moz-do-not-send="true" class="moz-txt-link-freetext">ray.gavin97@gmail.com</a>>:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="auto">A while ago, Per was working on a PR for
            visualizing MemorySegment and Buffer types
            <div dir="auto"><br>
            </div>
            <div dir="auto">It was very valuable:</div>
            <div dir="auto"><br>
            </div>
            <div dir="auto"><a href="https://github.com/openjdk/panama-foreign/pull/695" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/panama-foreign/pull/695</a></div>
            <div dir="auto"><br>
            </div>
            <div dir="auto">Does anyone know the status of this? I'd be
              grateful to have it available.</div>
          </div>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>