JDK-8227078 : Hide the onjcmd option from the help output
  • Type: CSR
  • Component: core-svc
  • Sub-Component: debugger
  • Priority: P2
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 13
  • Submitted: 2019-07-02
  • Updated: 2019-07-02
  • Resolved: 2019-07-02
Related Reports
CSR :  
Description
Summary
-------

Hide the onjcmd option of the jdwp agent and the corresponding VM.start_java_debugging command, without removing the functionality outright.

Problem
-------

According to JDK-8223456 the onjcmd option and the corresponding diagnostic command should be hidden as far as possible.

Solution
--------

The onjcmd option is not mentioned in the help output of the JDWP agent anymore. The corresponding diagnostic command VM.start_java_debugging is now registered as hidden, so it would not be included in the list of supported commands by jcmd or via the mbeans.

Apart from that the functionality is still working.

Specification
-------------

    diff --git a/src/hotspot/share/services/diagnosticCommand.cpp b/src/hotspot/share/services/diagnosticCommand.cpp
    --- a/src/hotspot/share/services/diagnosticCommand.cpp
    +++ b/src/hotspot/share/services/diagnosticCommand.cpp
    @@ -129,7 +129,7 @@
 
       // Debug on cmd (only makes sense with JVMTI since the agentlib needs it).
     #if INCLUDE_JVMTI
    -  DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<DebugOnCmdStartDCmd>(full_export, true, false));
    +  DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<DebugOnCmdStartDCmd>(full_export, true, true));
     #endif // INCLUDE_JVMTI
 
     }
    diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c b/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c
    --- a/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c
    +++ b/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c
    @@ -873,7 +873,6 @@
      "launch=<command line>            run debugger on event             none\n"
      "onthrow=<exception name>         debug on throw                    none\n"
      "onuncaught=y|n                   debug on any uncaught?            n\n"
    - "onjcmd=y|n                       start debug via jcmd?             n\n"
      "timeout=<timeout value>          for listen/attach in milliseconds n\n"
      "mutf8=y|n                        output modified utf-8             n\n"
      "quiet=y|n                        control over terminal messages    n\n"));




Comments
Moving the request to Finalized and Approving the request.
02-07-2019

Looks good to me. Adding myself as reviewer.
02-07-2019