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

rename jdb -trackvthreads and debug agent enumeratevthreads options and clarify "Preview Feature" nature of these options

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 19
    • core-svc
    • None
    • behavioral
    • minimal
    • The command line and agent options are new in JDK 19 so renaming them has no compatibility impact.
    • add/remove/modify command line option
    • JDK

      Summary

      Rename newly introduced jdb option -trackvthreads to -trackallthreads. Rename newly introduced debugger agent suboption enumeratevthreads to includevirtualthreads.

      Problem

      JEP 425 (JDK 19) added the command line option -trackvthreads to the jdb tool and the enumeratevthreads suboption to the debugger agent. The use of "vthread" in the option names sends the wrong signal to developers so these options need to be renamed.

      Solution

      Rename the options as per the summary.

      Specification

      After the update to help text, will look as follows:

      jdb doc (search for "trackallthreads"): http://cr.openjdk.java.net/~cjplummer/8286983/jdb.html

      -trackallthreads
          Track all threads as they are created, including virtual threads. See Working With Virtual Threads below. Virtual threads are a preview feature of the Java platform. 
      ...
      Working With Virtual Threads
      
      Virtual threads are a preview feature of the Java platform. Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.

      debug agent doc (seach for "includevirtualthreads"): http://cr.openjdk.java.net/~cjplummer/8286983/conninv.html

      $ jdb -listconnectors

      ...
        Connector: com.sun.jdi.CommandLineLaunch  Transport: dt_socket
          description: Launches target using Sun Java VM command line and attaches to it
      ...
          Argument: includevirtualthreads Default value: n
          description: List of all threads includes virtual threads as well as platform threads. Virtual threads are a preview feature of the Java platform.

      $ jdb -help

      Usage: jdb <options> <class> <arguments>
      
      where options include:
      ...
          -dbgtrace [flags] print info for debugging jdb
          -trackallthreads  Track all threads, including virtual threads.
                            Virtual threads are a preview feature of the Java platform.
          -tclient          run the application in the HotSpot(TM) Client Compiler
      ...

      $ man -M ./build/linux-x64-debug/images/jdk/man/ jdb

      ...
         -tclient
                Runs the application in the Java HotSpot VM client.
      
         -trackallthreads
                Track  all  threads  as  they  are  created,  including  Virtual
                Threads.   See  Working  With  Virtual  Threads  below.  Virtual
                threads are a preview feature of the Java platform.
      
         -tserver
                Runs the application in the Java HotSpot VM server.
      ...
      WORKING WITH VIRTUAL THREADS
             Virtual threads are a preview feature of the  Java  platform.   Preview
             features  may  be removed in a future release, or upgraded to permanent
             features of the Java platform.
      
             Often virtual theads are created in such large  numbers  and  frequency
      ...

      $ java -agentlib:jdwp=help

                     Java Debugger JDWP Agent Library
                     --------------------------------
      
        (See the "VM Invocation Options" section of the JPDA
         "Connection and Invocation Details" document for more information.)
      
      jdwp usage: java -agentlib:jdwp=[help]|[<option>=<value>, ...]
      
      Option Name and Value            Description                       Default
      ---------------------            -----------                       -------
      ...
      timeout=<timeout value>          for listen/attach in milliseconds n
      includevirtualthreads=y|n        List of all threads includes virtual threads as well as platform threads.
                                       Virtual threads are a preview feature of the Java platform.
                                                                         n
      mutf8=y|n                        output modified utf-8             n
      ...

            cjplummer Chris Plummer
            cjplummer Chris Plummer
            Alan Bateman, Alex Buckley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: