On Wed, 8 Jul 2026 10:43:06 GMT, Kieran Farrell <[email protected]> wrote:

>> This patch adds a new jcmd diagnostic command, `VM.show_settings`, to make 
>> the existing -`XshowSettings` output available from a running VM. The 
>> command accepts the same sections as`XshowSettings` (all, vm, properties, 
>> locale, security, system, security:all, security:properties, 
>> security:providers, security:tls). 
>> 
>> HotSpot registers the new diagnostic command, validates the requested 
>> section, then calls into `sun.launcher.LauncherHelper` to reuse the existing 
>> show settings formatting and return the result as bytes for the jcmd stream. 
>> The VM settings path also passes hotspots `InitialHeapSize`, `MaxHeapSize`, 
>> and Java thread stack size into the Java helper. A new jcmd test covers VM, 
>> properties, security TLS, and invalid-input output.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Kieran Farrell has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   add comment and update print_properties to use CHECK

Changes requested by dholmes (Reviewer).

src/hotspot/share/services/diagnosticCommand.cpp line 359:

> 357:   JavaCalls::call_static(&result, ik, method_name, signature, &args, 
> CHECK);
> 358: 
> 359:   if (HAS_PENDING_EXCEPTION) {

This is wrong. Now you have `CHECK` here you will never reach the if statement 
when an exception is pending.

And it remains unclear what affect exceptions will actually have on the 
execution of the command - what gets returned to the user via the jcmd 
invocation?

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

PR Review: https://git.openjdk.org/jdk/pull/31742#pullrequestreview-4659006380
PR Review Comment: https://git.openjdk.org/jdk/pull/31742#discussion_r3548223533

Reply via email to