Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8219143

jdb should support breakpoint thread filters

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: core-svc
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b10

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cjplummer Chris Plummer
              Reporter:
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: