On Thu, 4 Mar 2021 07:03:25 GMT, Chris Plummer <[email protected]> wrote:
>>> Yes, I'm starting to come to the same conclusion. The only code that
>>> constructs a `CLHSDB` object, and therefore triggers the potential call to
>>> `doUsage()`, is `CLHSDB.main()`, and it is only called from `SALauncher`
>>> when using `jhsdb clhsdb`. We could get rid of `main()` and have some other
>>> entrypoint that is passed the values of all the possible options, rather
>>> than having to parse them in CLHSDB.java.
>>>
>>> There is one test invokes java with the `CLHSDB` class. See SABase.java.
>>> It's part of ciReplay testing. I think it would be easily modified to just
>>> run `jhsdb clhsdb`
>>
>> I think `debugd` and `jsnap` are also remove `main()` if they have because
>> they do not provide commands like `jstack`.
>> I will file it to JBS, and will fix them later.
>
> BTW, referring back to the change to have attach handle pids and debug
> servernames, and the concern about a host having a numeric name, we already
> have code that assumes we don't have to deal with this in Tools.java. I just
> stumbled across this:
>
> try {
> pid = Integer.parseInt(args[0]);
> debugeeType = DEBUGEE_PID;
> } catch (NumberFormatException e) {
> // try remote server
> remoteServer = args[0];
> debugeeType = DEBUGEE_REMOTE;
> }
I think the changes look good now. Please create a CSR and then we can finish
the review of this PR.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2773