Re: RFR: 8282641: Make jdb "threadgroup" command with no args reset the current threadgroup back to the default [v2]

2022-03-03 Thread Chris Plummer
> jdb has a probably very little used command called "threadgroup" which is 
> used to set the current TheadGroup. The only purpose of the current 
> ThreadGroup is as the default ThreadGroup to use for the "threads" command 
> when no ThreadGroup argument is passed to it.
> 
> "threads" prints out every thread in the ThreadGroup specified as the first 
> argument. If none is specified, it uses the current ThreadGroup. If the 
> current ThreadGroup has not yet been specified, it automatically gets set to 
> the top level ThreadGroup.
> 
> Once the current ThreadGroup has been set by using the threadgroup command, 
> it's not that obvious how to reset it back to the default. It turns out the 
> way to do this to set it to the "system" ThreadGroup, which is the top level 
> ThreadGroup (and therefore the initial current ThreadGroup).
> 
> With this enhancement I've made it so if you use the "threadgroup" command 
> with no argument, it resets the current ThreadGroup back to the top level 
> ThreadGroup ("system"). Previously with no argument it produces an error for 
> not specifying the ThreadGroup argument.

Chris Plummer has updated the pull request incrementally with two additional 
commits since the last revision:

 - Use THREADGROUP_NAME instead of "MyThreadGroup#"
 - fix minor typo in help text

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7687/files
  - new: https://git.openjdk.java.net/jdk/pull/7687/files/ad800de5..fb7ac63f

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7687&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7687&range=00-01

  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7687.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7687/head:pull/7687

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


Re: RFR: 8282641: Make jdb "threadgroup" command with no args reset the current threadgroup back to the default [v2]

2022-03-07 Thread Kevin Walls
On Fri, 4 Mar 2022 07:34:35 GMT, Chris Plummer  wrote:

>> jdb has a probably very little used command called "threadgroup" which is 
>> used to set the current TheadGroup. The only purpose of the current 
>> ThreadGroup is as the default ThreadGroup to use for the "threads" command 
>> when no ThreadGroup argument is passed to it.
>> 
>> "threads" prints out every thread in the ThreadGroup specified as the first 
>> argument. If none is specified, it uses the current ThreadGroup. If the 
>> current ThreadGroup has not yet been specified, it automatically gets set to 
>> the top level ThreadGroup.
>> 
>> Once the current ThreadGroup has been set by using the threadgroup command, 
>> it's not that obvious how to reset it back to the default. It turns out the 
>> way to do this to set it to the "system" ThreadGroup, which is the top level 
>> ThreadGroup (and therefore the initial current ThreadGroup).
>> 
>> With this enhancement I've made it so if you use the "threadgroup" command 
>> with no argument, it resets the current ThreadGroup back to the top level 
>> ThreadGroup ("system"). Previously with no argument it produces an error for 
>> not specifying the ThreadGroup argument.
>
> Chris Plummer has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Use THREADGROUP_NAME instead of "MyThreadGroup#"
>  - fix minor typo in help text

Looks good.
(Choosing the null or top-level thread group means to show all threads in all 
thread groups, that makes sense though I didn't find if we say it anywhere.  A 
niche feature like you say, but good to have a way back from choosing a thread 
group!)

-

Marked as reviewed by kevinw (Committer).

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