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

SA tools not providing option to connect to debug server

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 14
    • hotspot
    • None
    • behavioral
    • minimal
    • Introducing new command line option for jhsdb, and it does not affect to other modes in jhsdb. Thus compatibility risk is none.
    • add/remove/modify command line option
    • JDK

        Summary

        Add ability for connecting to debug server to a part of jhsdb commands (jstack, jmap, jinfo, jsnap).

        Problem

        In JDK 8 or earlier, some tools (jstack, jmap, jinfo) can connect to debug server (jsadebugd). However it has not done so since JDK 9 because jhsdb cannot accept the attach request to debug server.

        Solution

        Introduce --connect option to jhsdb to connect to remote debug server.

        Specification

        jstack, jmap, jinfo, jsnap in jhsdb can accept --connect option to connect to remote debug server. Other subcommands (hsdb, clhsdb, debugd, help) would not be changed.

        The following help output is being added to each of the above jhsdb sub-commands:

        --connect [<id>@]<host> To connect to a remote debug server (debugd).
        ...
        The --connect option can be set to connect to a debug server (debugd).
        --core, --pid, and --connect are mutually exclusive.

        jstack:

        $ jhsdb jstack --help
            --locks                 To print java.util.concurrent locks.
            --mixed                 To print both Java and native frames (mixed mode).
            --pid <pid>             To attach to and operate on the given live process.
            --core <corefile>       To operate on the given core file.
            --exe <executable for corefile>
            --connect [<id>@]<host> To connect to a remote debug server (debugd).
        
            The --core and --exe options must be set together to give the core
            file, and associated executable, to operate on. They can use
            absolute or relative paths.
            The --pid option can be set to operate on a live process.
            The --connect option can be set to connect to a debug server (debugd).
            --core, --pid, and --connect are mutually exclusive.
        
            Examples: jhsdb jstack --pid 1234
                  or  jhsdb jstack --core ./core.1234 --exe ./myexe
                  or  jhsdb jstack --connect debugserver
                  or  jhsdb jstack --connect id@debugserver

        jmap:

        $ jhsdb jmap --help
            <no option>             To print same info as Solaris pmap.
            --heap                  To print java heap summary.
            --binaryheap            To dump java heap in hprof binary format.
            --dumpfile <name>       The name of the dump file.
            --histo                 To print histogram of java object heap.
            --clstats               To print class loader statistics.
            --finalizerinfo         To print information on objects awaiting finalization.
            --pid <pid>             To attach to and operate on the given live process.
            --core <corefile>       To operate on the given core file.
            --exe <executable for corefile>
            --connect [<id>@]<host> To connect to a remote debug server (debugd).
        
            The --core and --exe options must be set together to give the core
            file, and associated executable, to operate on. They can use
            absolute or relative paths.
            The --pid option can be set to operate on a live process.
            The --connect option can be set to connect to a debug server (debugd).
            --core, --pid, and --connect are mutually exclusive.
        
            Examples: jhsdb jmap --pid 1234
                  or  jhsdb jmap --core ./core.1234 --exe ./myexe
                  or  jhsdb jmap --connect debugserver
                  or  jhsdb jmap --connect id@debugserver

        jinfo:

        $ jhsdb jinfo --help
            --flags                 To print VM flags.
            --sysprops              To print Java System properties.
            <no option>             To print both of the above.
            --pid <pid>             To attach to and operate on the given live process.
            --core <corefile>       To operate on the given core file.
            --exe <executable for corefile>
            --connect [<id>@]<host> To connect to a remote debug server (debugd).
        
            The --core and --exe options must be set together to give the core
            file, and associated executable, to operate on. They can use
            absolute or relative paths.
            The --pid option can be set to operate on a live process.
            The --connect option can be set to connect to a debug server (debugd).
            --core, --pid, and --connect are mutually exclusive.
        
            Examples: jhsdb jinfo --pid 1234
                  or  jhsdb jinfo --core ./core.1234 --exe ./myexe
                  or  jhsdb jinfo --connect debugserver
                  or  jhsdb jinfo --connect id@debugserver 

        jsnap:

        $ jhsdb jsnap --help
            --all                   To print all performance counters.
            --pid <pid>             To attach to and operate on the given live process.
            --core <corefile>       To operate on the given core file.
            --exe <executable for corefile>
            --connect [<id>@]<host> To connect to a remote debug server (debugd).
        
            The --core and --exe options must be set together to give the core
            file, and associated executable, to operate on. They can use
            absolute or relative paths.
            The --pid option can be set to operate on a live process.
            The --connect option can be set to connect to a debug server (debugd).
            --core, --pid, and --connect are mutually exclusive.
        
            Examples: jhsdb jsnap --pid 1234
                  or  jhsdb jsnap --core ./core.1234 --exe ./myexe
                  or  jhsdb jsnap --connect debugserver
                  or  jhsdb jsnap --connect id@debugserver

              ysuenaga Yasumasa Suenaga
              sballal Sharath Ballal (Inactive)
              Serguei Spitsyn
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: