On Tue, 2 Mar 2021 05:18:51 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

>>> You'll need a CSR for this.
>> 
>> Ok, I will add it after this discussion ( `coonect` or `attach` )
>> 
>>> Will `jhsdb clhsdb --connect debugserver` work? If not, it should to be 
>>> consistent with the other commands.
>> 
>> It does not work. CLHSDB and HSDB do not accept '--connect'. I plan to add 
>> it after this PR.
>> 
>>> Does `detach` undo the `connect`?
>> 
>> Yes.
>> 
>>> It's not very symetric if we do since we already had `attach` + `detach` 
>>> and now you added `connect` + `detach`. Since you can `attach` to a pid or 
>>> a core file, maybe instead of adding `connect` you should just put the 
>>> debugd support in `attach`.
>> 
>> I thought `connect` command is easy to understand because it is similar with 
>> `--connect` option in jhsdb, and also the change is smaller than adding to 
>> `attach` because `attach` already has 1 string argument (PID).
>> I'm not familiar of network, but I concern hostname which is configured by 
>> numeric chars only - I'm not sure it is allowed, but [RFC 
>> 1123](https://tools.ietf.org/html/rfc1123) allows digit character at the 
>> first.
>> 
>>       The syntax of a legal Internet host name was specified in RFC-952
>>       [DNS:4].  One aspect of host name syntax is hereby changed: the
>>       restriction on the first character is relaxed to allow either a
>>       letter or a digit.  Host software MUST support this more liberal
>>       syntax.
>> 
>> If digit hostname (e.g. 1234) is allowed, we cannot add debugd support to 
>> `attach` because we cannot distinguish it is PID or hostname. If so, it is 
>> reasonable to add `connect` command for this purpose.
>
> `jhsdb` has `--pid`, `--core`, and `--connect` as the 3 ways to "attach" for 
> lack of a better word. It would have been nice if the clhsdb command did a 
> better job of copying these three command line arguments. You are suggesting 
> that adding a `connect` command would have similarity to the `--connect` 
> option, but unfortunately the `attach` command has no such similarity with 
> the command line arguments `--pid` and `--core`, so I'm not so sure doing so 
> with `connect` is actually helping in that regard, especially when "connect" 
> and "attach" pretty much mean the same thing.
> 
> As for numeric host names, yes, that is possible, but then you could also 
> have a numeric core file name. If we really want to avoid the numeric host 
> name problem, perhaps something like `attachd` would be better than 
> `connect`, but it seems any choice we make will have it's drawbacks due the 
> the baggage of existing commands and options.

> @plummercj Ok, I try to add debug server support to `attach` clhsdb command. 
> Then should we still need CSR?

Pushed new commit to be implemented as `attach`. It works fine with 
serviceability/sa jtreg tests on my Linux x64.
I will add CSR if you are ok.

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

PR: https://git.openjdk.java.net/jdk/pull/2773

Reply via email to