RFR: 8337662: Improve os::print_hex_dump for printing Instructions sections [v5]

Martin Doerr mdoerr at openjdk.org
Mon Aug 12 21:35:33 UTC 2024


On Tue, 6 Aug 2024 15:33:44 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> Currently we use os::print_hex_dump for printing Instruction sections in the hserr file. The function could be slightly improved, .e.g. by showing directly the pc .
>> The instructions section would for example look like this, with a small helper '=>' pointing to the pc. Makes the output more readable.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add gtest

I think it's good. Let's hear what others think.

src/hotspot/share/runtime/os.cpp line 1019:

> 1017: 
> 1018: void os::print_hex_dump(outputStream* st, const_address start, const_address end, int unitsize,
> 1019:                         bool print_ascii, int bytes_per_line, const_address logical_start,  const_address highlight_address) {

Extra whitespace.

test/hotspot/gtest/runtime/test_os.cpp line 216:

> 214: #define PAT_HL_1B "  " ADDRESS1 ":   ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??\n" \
> 215:               "=>" ADDRESS2 ":   ff ff e0 dc 23 00 6a 64 6b 2f 69 6e 74 65 72 6e 61 6c 2f 6c 6f 61 64 65 72 2f 4e 61 74 69 76 65   " ASCII_1 "\n" \
> 216:               "  " ADDRESS3 ":   4c 69 62 72 61 72 69 65 73 00 00 00 00 00 00 00                                                   " ASCII_2 "\n"

Maybe improve indentation?

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

PR Review: https://git.openjdk.org/jdk/pull/20419#pullrequestreview-2234052110
PR Review Comment: https://git.openjdk.org/jdk/pull/20419#discussion_r1714388823
PR Review Comment: https://git.openjdk.org/jdk/pull/20419#discussion_r1714391322


More information about the hotspot-runtime-dev mailing list