RFR: 8263342: Add --connect option to jhsdb hsdb/clhsdb [v2]

Yasumasa Suenaga ysuenaga at openjdk.java.net
Thu Mar 11 01:22:08 UTC 2021


On Thu, 11 Mar 2021 00:33:46 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

> Yes, I understood that part. I just wanted to make sure, for example, that we weren't previously supporting something like attach <exe_path> in clhsdb, and that would be impacted by this, but I'm pretty sure clhsdb already prevents doing that.

It would check at `SALauncher::buildAttachArgs` https://github.com/openjdk/jdk/blob/32cbd193d9655825d10e07be50ab3b7550ecb401/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java#L202-L213

> However, what if you used jshdb <cmd> --exe and don't specify a core file. Did that ever work, and if so will it still work?

Due to above code snippets, we can see the usage on the console in JDK 15 as following, and it is same behavior after this change.

$ jhsdb clhsdb --exe /java
You have to set --core.
    --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>

    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.
    --core and --pid are mutually exclusive.

    Examples: jhsdb clhsdb --pid 1234
          or  jhsdb clhsdb --core ./core.1234 --exe ./myexe

-------------

PR: https://git.openjdk.java.net/jdk/pull/2908


More information about the serviceability-dev mailing list