On Tue, 2 Mar 2021 22:31:22 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
> This pre-existing code in CLHSDB.java is a little concerning: > > ``` > 127 private void doUsage() { > 128 System.out.println("Usage: java CLHSDB [[pid] | > [path-to-java-executable [path-to-corefile]] | help ]"); > 129 System.out.println(" pid: attach to > the process whose id is 'pid'"); > 130 System.out.println(" path-to-java-executable: Debug a > core file produced by this program"); > 131 System.out.println(" path-to-corefile: Debug > this corefile. The default is 'core'"); > 132 System.out.println(" If no arguments are specified, you > can select what to do from the GUI.\n"); > 133 HotSpotAgent.showUsage(); > 134 } > ``` > > First concern is that you have not added "debug server" support to it. 2nd > concern is the "If no arguments are specified, you can select what to do from > the GUI" part. It looks like using the GUI you can launch the CLHSDB console, > although I can't find in the source where/how that is actually done. In any > case, i don't see any way to pass command arguments when you do that. I just added the feature to connect to debug server, so I did not change `CLHSDB(String[] args)` and help message. I think it should be changed when we add `--connect` option to `jhsdb clhsdb`. (I will work for it after this PR) > > I'm just wondering how much of this CLHSDB support we want to keep beyond > what the clhsdb command needs. Do we still want to support invoking > CLHSDB.main() from the java command line? I think we should remove `main()` from CLHSDB/HSDB to be honest because they are called from SALauncher, and we cannot call them directly because they are not exported in module-info. ------------- PR: https://git.openjdk.java.net/jdk/pull/2773