Hi all,

I've made the patch that was discussed here.
<https://mail.openjdk.java.net/pipermail/serviceability-dev/2019-May/028042.html>

This patch fixes the following JBS ticket.
<https://bugs.openjdk.java.net/browse/JDK-8223814>

I attached the patch to this email.
This patch passes serviceability/sa jtreg tests.

Could you help? I would like to contribute it. I need a sponsor.
(My company has signed to OCA (NTT Comware Corporation))


Thanks,
Osamu
diff -r 6ec71a88b68e src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java	Tue May 21 00:52:04 2019 -0700
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java	Thu May 23 17:54:53 2019 +0900
@@ -45,13 +45,19 @@
         return false;
     }
 
-    private static boolean commonHelp() {
+    private static boolean commonHelp(String mode) {
         // --pid <pid>
         // --exe <exe>
         // --core <core>
         System.out.println("    --exe\t<executable image name>");
         System.out.println("    --core\t<path to coredump>");
         System.out.println("    --pid\t<pid of process to attach>");
+        System.out.println("");
+        System.out.println("    --pid and --exe are mutually execlusive, and --core only goes with --exe.");
+        System.out.println("    Arguments following the --exe and --core can be absolute or relative path.");
+        System.out.println("");
+        System.out.println("    Examples: jhsdb " + mode + " --pid <pid>");
+        System.out.println("          or  jhsdb " + mode + " --exe <executable> --core <core>");
         return false;
     }
 
@@ -59,16 +65,16 @@
         // [options] <pid> [server-id]
         // [options] <executable> <core> [server-id]
         System.out.println("    --serverid\t<unique id for this debug server>");
-        return commonHelp();
+        return commonHelp("debugd");
     }
 
     private static boolean jinfoHelp() {
         // --flags -> -flags
         // --sysprops -> -sysprops
-        System.out.println("    --flags\tto print VM flags");
-        System.out.println("    --sysprops\tto print Java System properties");
-        System.out.println("    <no option>\tto print both of the above");
-        return commonHelp();
+        System.out.println("    --flags\t<to print VM flags>");
+        System.out.println("    --sysprops\t<to print Java System properties>");
+        System.out.println("    <no option>\t<to print both of the above>");
+        return commonHelp("jinfo");
     }
 
     private static boolean jmapHelp() {
@@ -78,27 +84,27 @@
         // --clstats -> -clstats
         // --finalizerinfo -> -finalizerinfo
 
-        System.out.println("    <no option>\tto print same info as Solaris pmap");
-        System.out.println("    --heap\tto print java heap summary");
-        System.out.println("    --binaryheap\tto dump java heap in hprof binary format");
-        System.out.println("    --dumpfile\tname of the dump file");
-        System.out.println("    --histo\tto print histogram of java object heap");
-        System.out.println("    --clstats\tto print class loader statistics");
-        System.out.println("    --finalizerinfo\tto print information on objects awaiting finalization");
-        return commonHelp();
+        System.out.println("    <no option>\t<to print same info as Solaris pmap>");
+        System.out.println("    --heap\t<to print java heap summary>");
+        System.out.println("    --binaryheap\t<to dump java heap in hprof binary format>");
+        System.out.println("    --dumpfile\t<name of the dump file>");
+        System.out.println("    --histo\t<to print histogram of java object heap>");
+        System.out.println("    --clstats\t<to print class loader statistics>");
+        System.out.println("    --finalizerinfo\t<to print information on objects awaiting finalization>");
+        return commonHelp("jmap");
     }
 
     private static boolean jstackHelp() {
         // --locks -> -l
         // --mixed -> -m
-        System.out.println("    --locks\tto print java.util.concurrent locks");
-        System.out.println("    --mixed\tto print both java and native frames (mixed mode)");
-        return commonHelp();
+        System.out.println("    --locks\t<to print java.util.concurrent locks>");
+        System.out.println("    --mixed\t<to print both java and native frames (mixed mode)>");
+        return commonHelp("jstack");
     }
 
     private static boolean jsnapHelp() {
-        System.out.println("    --all\tto print all performance counters");
-        return commonHelp();
+        System.out.println("    --all\t<to print all performance counters>");
+        return commonHelp("jsnap");
     }
 
     private static boolean toolHelp(String toolName) {
@@ -117,8 +123,11 @@
         if (toolName.equals("debugd")) {
             return debugdHelp();
         }
-        if (toolName.equals("hsdb") || toolName.equals("clhsdb")) {
-            return commonHelp();
+        if (toolName.equals("hsdb")) {
+            return commonHelp("hsdb");
+        }
+        if (toolName.equals("clhsdb")) {
+            return commonHelp("clhsdb");
         }
         return launcherHelp();
     }

Reply via email to