RFR: 8369322: Implement native stack printing for Windows-AArch64 [v2]

Martijn Verburg karianna at openjdk.org
Mon Oct 20 20:17:06 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

src/hotspot/os/windows/os_windows.cpp line 6286:

> 6284: 
> 6285: /*
> 6286:  * Windows/x64 does not use stack frames the way expected by Java:

Should that comment say /x64 if it's for all aarchs?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27680#discussion_r2446012865


More information about the hotspot-runtime-dev mailing list