RFR: 8293851: hs_err should print more stack in hex dump

Thomas Stuefe stuefe at openjdk.org
Thu Sep 15 14:37:44 UTC 2022


On Thu, 15 Sep 2022 14:25:41 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/share/runtime/os.hpp line 766:
>> 
>>> 764:   static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
>>> 765:   static void print_date_and_time(outputStream* st, char* buf, size_t buflen);
>>> 766:   static void print_stack(outputStream* st, address sp, int unitsize);
>> 
>> I'd rename this to something like `print_stack_as_hex_dump()` or similar since print_stack suggests you print a stack, and because we already have `platform_print_native_stack()` and `get_native_stack()`.
>
> Yeah. This looks like a helper function for `print_tos_pc`, so I can just name it `print_tos` -- it would be enough to disambiguate against the "real" stack printing functions. It also captures the intent better: we are not printing the entirety of the stack, or even care if we cross any stack frames, etc.

print_tos_pc itself is weird, since it does two unrelated things, but this is fine for a separate cleanup. Thanks for renaming.

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

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


More information about the hotspot-runtime-dev mailing list