RFR: 8369322: Implement native stack printing for Windows-AArch64 [v2]
David Holmes
dholmes at openjdk.org
Thu Oct 9 04:51:04 UTC 2025
On Wed, 8 Oct 2025 19:30:19 GMT, Saint Wesonga <duke at openjdk.org> wrote:
>> HAVE_PLATFORM_PRINT_NATIVE_STACK is not defined on Windows AArch64. Consequently, Windows AArch64 uses the [implementation of os::platform_print_native_stack that returns false](https://github.com/openjdk/jdk/blob/b50c11f9077f071cf5639de7e82ec261e0338532/src/hotspot/share/runtime/os.inline.hpp#L36-L41). This results in [NativeStackPrinter::print_stack](https://github.com/openjdk/jdk/blob/b50c11f9077f071cf5639de7e82ec261e0338532/src/hotspot/share/utilities/nativeStackPrinter.cpp#L32) having to call [NativeStackPrinter::print_stack_from_frame](https://github.com/openjdk/jdk/blob/b50c11f9077f071cf5639de7e82ec261e0338532/src/hotspot/share/utilities/nativeStackPrinter.hpp#L99-L106) instead. However, the context is null in that case. As a result, the [frame used for printing the stack](https://github.com/openjdk/jdk/blob/b50c11f9077f071cf5639de7e82ec261e0338532/src/hotspot/share/utilities/nativeStackPrinter.hpp#L103) is obtained from [os::current_frame()](https://github.com/openjdk/jdk/
blob/b50c11f9077f071cf5639de7e82ec261e0338532/src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.cpp#L165-L168), which returns an empty frame. The frame's pc() method returns `nullptr` and `Native frames: <unavailable>` is printed.
>>
>> This change defines the `os::platform_print_native_stack` method for Windows AArch64 and adapts the implementation of the Windows x64 `os::win32::platform_print_native_stack` method to support Windows AArch64.
>
> Saint Wesonga has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix style nits
Marked as reviewed by dholmes (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/27680#pullrequestreview-3317211229
More information about the hotspot-runtime-dev
mailing list