JDK-8219143: jdb should support breakpoint thread filters
Chris Plummer
chris.plummer at oracle.com
Wed Feb 20 05:57:12 UTC 2019
Hello,
Please review the following:
http://cr.openjdk.java.net/~cjplummer/8219143/webrev.00/
https://bugs.openjdk.java.net/browse/JDK-8219143
Normally when a breakpoint is set in jdb, it is set globally (all
threads). JDI supports the ability to have the breakpoint be
automatically filtered so it will only be delivered on a specified
thread and ignored on all other threads. This change allows making use
of that JDI feature from jdb. So instead of something like:
stop at Foo:23
You can now do:
stop at threadid 7 Foo:23
Where 7 is the threadID for the thread as seen in the output of the
"threads" command. The format of the stop command is now:
stop [go|thread] <at|in> [threadid <thread_id>] <location>
It is still fully backwards compatible.
As part of this change I also cleaned up the "stop" command parsing and
error handling. It was kind of a mess, and was near impossible to add
the "threadid" option until after I did much of the cleanup. I've also
cleaned up the help output a lot, and added help for the "go" and
"thread" options. One last change was to remove the distinction between
"stop at" and "stop in", which was suggested already in a comment. They
can be used interchangeably now. The changes in Commands.java are pretty
much all just the above cleanup, except for the one short section with
the 'Handle "threadid" modifier' comment.
thanks,
Chris
More information about the serviceability-dev
mailing list