On Wed, 30 Sep 2020 17:51:20 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

>> `jvmti_tools.cpp` wasn't changed by this PR, `jvmti_tools.cpp` always 
>> accepted ` `, `~` and/or `,` as delimiters[[*]].
>> as jtreg splits arguments by space symbol, we can't use ` ` in `-agentlib:`, 
>> so we had to change the delimiter used
>> there to either `,` or `~`, `nsk/share/jvmti/ArgumentHandler` takes these 
>> options (via `getAgentOptionsString`) and
>> then parse in `parseOptionString`. but `parseOptionString` was using 
>> `StringTokenizer` w/ default delimiters, ie `
>> \t\n\r\f`, and as a result it wasn't splitting options correctly after we 
>> changed the delimiter used in tests'
>> `-agentlib`. in other words, this change is just fixing an old bug which we 
>> didn't care before as we always used ` ` in
>> this agent's options.   [*]:
>> https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/jvmti_tools.cpp#L224
>
> I guess a better question would be is where is ~ being used in the arguments?

not in the tests which use `nsk/share/jvmti/ArgumentHandler`, otherwise, we 
would see these tests failing as wouldn't
parse them correctly. quick grepping showed that that
 * `~` is used in `vm/mlvm/*/jvmti` tests, but these tests don't use 
`nsk/share/jvmti/ArgumentHandler`, they use
   `nsk/share/ArgumentParser/IgnoreUnknownArgumentParser` which doesn't parse 
agent options string at all
 * `,` has been used in `nsk/jvmti/scenarios/contention/TC05/tc05t001/` before 
this patch, and the test wasn't getting
   options right, it was setting `verbose,waittime` equal to `5`, instead of 
`verbose` to an empty string and `waittime`
   to `5`.

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

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

Reply via email to