RFR: 8342607: Enhance register printing on x86_64 platforms [v8]
Martin Doerr
mdoerr at openjdk.org
Mon Oct 28 19:46:21 UTC 2024
On Mon, 28 Oct 2024 19:34:07 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
>> Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add sanity check: fpregs should point into the context.
>
> src/hotspot/share/utilities/debug.cpp line 738:
>
>> 736: if ((address)((const ucontext_t*)context)->uc_mcontext.fpregs > (address)context) {
>> 737: size_t fpregs_offset = pointer_delta(((const ucontext_t*)context)->uc_mcontext.fpregs, context, 1);
>> 738: if (fpregs_offset < sizeof(ucontext_t)) {
>
> I think you should set `fpregs` to null if the original `fpregs` is invalid. The message in `print_context` will be confusing otherwise.
> But I'll leave it to you assuming it'll never happen. Personally I think we should not try to avoid the assertion in `pointer_delta` and keep the code concise.
I think null would be invalid, too. I prefer not touching it if it's already broken.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21615#discussion_r1819654332
More information about the hotspot-compiler-dev
mailing list