RFR: 8262520: Add SA Command Line Debugger support to connect to debug server [v5]

Chris Plummer cjplummer at openjdk.java.net
Fri Mar 5 07:07:03 UTC 2021


On Thu, 4 Mar 2021 00:02:04 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:

>> `attach` command on CLHSDB supports to attach live process (PID) and coredump, but it cannot connect to debug server. CLHSDB does not have a command to connect to debug server.
>> 
>> Other jhsdb commands (jstack, jmap, etc...) can connect debug server via `--connect` option, so CLHSDB should connect to it.
>> 
>> After this change, you can connect to debug server with 'connect <hostname>'.
>
> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update error message in CLHSDB

test/hotspot/jtreg/serviceability/sa/sadebugd/ClhsdbAttachToDebugServer.java line 95:

> 93:             out.shouldMatch("^java/lang/Object @0x[0-9a-f]+$"); // for "class java.lang.Object"
> 94:             out.shouldMatch("^java/lang/String @0x[0-9a-f]+$"); // for "class java.lang.String"
> 95:             out.shouldHaveExitValue(0);

I think you should do more error checking here. If you look at ClhsdbLauncher you will see:
        // This will detect most SA failures, including during the attach.
        oa.shouldNotMatch("^sun.jvm.hotspot.debugger.DebuggerException:.*$");
        // This will detect unexpected exceptions, like NPEs and asserts, that are caught
        // by sun.jvm.hotspot.CommandProcessor.
        oa.shouldNotMatch("^Error: .*$");
I think you could use something similar here.

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

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


More information about the serviceability-dev mailing list