JDI supports putting a thread filter on a breakpoint, making it so the breakpoint is only triggered if the breakpoint happens on the specified thread. jdb does not provide any way to leverage this JDI feature. Although probably not commonly needed jdb users, I've found it useful when debugging the jdwp debug agent, especially when working on the debug agent filtering code while adding debugging support for fibers.
The current syntax for the "stop" command is:
stop [go | thread] <at | in> <loc>
The proposal for adding thread filtering is to change the syntax to:
stop [go | thread] <at | in> [threadid <threadid>] <loc>
This is backwards compatible with the old syntax. Also, the help output for the stop command is currently not very good:
stop in <class id>.<method>[(argument_type,...)]
-- set a breakpoint in a method
stop at <class id>:<line> -- set a breakpoint at a line
It does not mention the "go" or "thread" options, and now I need to add the <threadID> options. I will clean it up to look like:
stop [go|thread] <at|in> [threadid <thread id>] <loc>
-- <loc> can either be a line number or a method:
-- <class id>:<line>
-- <class id>.<method>[(argument_type,...)]
-- if "go" is specified, immediately resume after stopping
-- if "thread" is specified, only suspend the thread we stop in
-- if neither "go" nor "thread" are specified, suspend all threads
-- if [threadid <threadid>] is specified, only stop in the specified thread
As part of this I'm going to remove the distinction between "at" and "in", which has already been suggested in the jdb comments.
The current syntax for the "stop" command is:
stop [go | thread] <at | in> <loc>
The proposal for adding thread filtering is to change the syntax to:
stop [go | thread] <at | in> [threadid <threadid>] <loc>
This is backwards compatible with the old syntax. Also, the help output for the stop command is currently not very good:
stop in <class id>.<method>[(argument_type,...)]
-- set a breakpoint in a method
stop at <class id>:<line> -- set a breakpoint at a line
It does not mention the "go" or "thread" options, and now I need to add the <threadID> options. I will clean it up to look like:
stop [go|thread] <at|in> [threadid <thread id>] <loc>
-- <loc> can either be a line number or a method:
-- <class id>:<line>
-- <class id>.<method>[(argument_type,...)]
-- if "go" is specified, immediately resume after stopping
-- if "thread" is specified, only suspend the thread we stop in
-- if neither "go" nor "thread" are specified, suspend all threads
-- if [threadid <threadid>] is specified, only stop in the specified thread
As part of this I'm going to remove the distinction between "at" and "in", which has already been suggested in the jdb comments.
- relates to
-
JDK-8219507 when listing breakpoints, jdb should include more info about the breakpoint
-
- Closed
-