RFR: 8292201: serviceability/sa/ClhsdbThreadContext.java fails with "'Thread "Common-Cleaner"' missing from stdout/stderr" [v2]
Chris Plummer
cjplummer at openjdk.org
Thu Sep 1 21:21:31 UTC 2022
On Thu, 1 Sep 2022 20:10:45 GMT, Alex Menkov <amenkov at openjdk.org> wrote:
>> Chris Plummer has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits:
>>
>> - Merge
>> - Fix jcheck error
>> - Undo some temp test changes.
>> - Fix 64-bit alignment requirements
>
> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java line 242:
>
>> 240: private boolean canUsePageCacheFor64bitRead(long address) {
>> 241: long pageMask = ~(pageSize - 1);
>> 242: if ((address & pageMask) != ((address + 4) & pageMask)) {
>
> This looks a bit over-complicated.
> Maybe something like
> ` long pageMask = pageSize - 1;
> if ((address & pageMask) > (pageSize - 8)) {
> return false;
> }`
I tinkered with this code quite a bit before I had something that both worked and I liked. I don't know that your approach is actually any simpler, and at the moment I still prefer mine, but that might just be because I'm more familiar with it. However, it does seem that there should be a more elegant way of doing this.
-------------
PR: https://git.openjdk.org/jdk/pull/10090
More information about the serviceability-dev
mailing list