Integrated: 8311542: Consolidate the native stack printing code

David Holmes dholmes at openjdk.org
Thu Dec 12 23:18:44 UTC 2024


On Mon, 2 Dec 2024 07:36:59 GMT, David Holmes <dholmes at openjdk.org> wrote:

> We now print native stacks in a number of contexts, not just VMError reporting, and we have to try `os::platform_print_native_stack` else fall back to `VMError::print_native stack`. 
> 
> The refactoring adds a new `NativeStackPrinter` (NSP) helper class which can be constructed with some of the context information for the printing that will follow. This avoids the need for the print functions to have a large number of parameters. We have to expose both the top-level printing functionality and the "lower-level" frame-based stack walk as the error reporter needs access to that directly. To maintain the exact same format of output the NSP has to be aware of some error reporter usage requirements.
> 
> I also had to expose a direct `frame` taking print function for the Debug.cpp `pns` case.
> 
> Testing:
>  - tiers 1 - 4
> 
> Some frame management code was also moved from `VMError` to the `frame` class.

This pull request has now been integrated.

Changeset: db9eab3f
Author:    David Holmes <dholmes at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/db9eab3f29e9cb26a8c0a7c31c55aaf140f21bed
Stats:     352 lines in 9 files changed: 234 ins; 96 del; 22 mod

8311542: Consolidate the native stack printing code

Reviewed-by: kbarrett, jwaters

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

PR: https://git.openjdk.org/jdk/pull/22472


More information about the hotspot-runtime-dev mailing list