On Thu, 18 Jun 2026 23:37:34 GMT, Yasumasa Suenaga <[email protected]> wrote:

> DWARF parser on AArch64 has been supported since 
> [JDK-8377946](https://bugs.openjdk.org/browse/JDK-8377946) (PR #29731), but 
> warning message would be shown to notice call frames which are the result of 
> mixed jstack might be incorrect if PAC (Pointer Authentication Code) is 
> enabled. However it does not work.
> 
> `pac_enabled` is declared as `bool` as a member of `ps_prochandle` in 
> libproc_impl.h. Accessor function is defined in libproc_impl.c. `bool` might 
> not be defined by default in C, so it is defined in libproc.c as following:
> 
> 
> // This C bool type must be int for compatibility with Linux calls and
> // it would be a mistake to equivalence it to C++ bool on many platforms
> #ifndef __cplusplus
> typedef int bool;
> #define true 1
> #define false 0
> #endif
> 
> 
> OTOH `pac_enabled()` would be called in LinuxDebuggerLocal.cpp. C++ has 
> `bool` by default as 1 byte data. `HWCAP_PACA` is defined as 0x40000000, thus 
> it would be `false` even if `HWCAP_PACA` is set because 1st byte of 
> `HWCAP_PACA` is zero.
> 
> Hence we need to set the value as boolean to `pac_enabled` explicitly.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Yes good observation, this looks better.

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

Marked as reviewed by kevinw (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/31583#pullrequestreview-4542479754

Reply via email to