< prev index next >

src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

@@ -45,10 +45,13 @@
      static private final String ARG_MAIN = "main";
      static private final String ARG_INIT_SUSPEND = "suspend";
      static private final String ARG_QUOTE = "quote";
      static private final String ARG_VM_EXEC = "vmexec";
  
+     static private final String ARG_VM_ENUMERATE_VTHREADS = "enumeratevthreads";
+     static private final String ARG_VM_NOTIFY_VTHREADS    = "notifyvthreads";
+ 
      TransportService transportService;
      Transport transport;
      boolean usingSharedMemory = false;
  
      TransportService transportService() {

@@ -128,10 +131,22 @@
                  ARG_VM_EXEC,
                  getString("sun.vm_exec.label"),
                  getString("sun.vm_exec"),
                  "java",
                  true);
+         addStringArgument(
+                 ARG_VM_ENUMERATE_VTHREADS,
+                 getString("sun.vm_enumerate_vthreads.label"),
+                 getString("sun.vm_enumerate_vthreads"),
+                 "n",
+                 false);
+         addStringArgument(
+                 ARG_VM_NOTIFY_VTHREADS,
+                 getString("sun.vm_notify_vthreads.label"),
+                 getString("sun.vm_notify_vthreads"),
+                 "y",
+                 false);
      }
  
      static boolean hasWhitespace(String string) {
          int length = string.length();
          for (int i = 0; i < length; i++) {

@@ -154,10 +169,12 @@
          String mainClassAndArgs = argument(ARG_MAIN, arguments).value();
          boolean wait = ((BooleanArgumentImpl)argument(ARG_INIT_SUSPEND,
                                                    arguments)).booleanValue();
          String quote = argument(ARG_QUOTE, arguments).value();
          String exe = argument(ARG_VM_EXEC, arguments).value();
+         String enumerateVThreads = argument(ARG_VM_ENUMERATE_VTHREADS, arguments).value();
+         String notifyVThreads = argument(ARG_VM_NOTIFY_VTHREADS, arguments).value();
          String exePath = null;
  
          if (quote.length() > 1) {
              throw new IllegalConnectorArgumentsException("Invalid length",
                                                           ARG_QUOTE);

@@ -211,11 +228,13 @@
                  exePath = quote + exePath + quote;
              }
  
              String xrun = "transport=" + transport().name() +
                            ",address=" + address +
-                           ",suspend=" + (wait? 'y' : 'n');
+                           ",suspend=" + (wait? 'y' : 'n') +
+                           ",enumeratevthreads=" + enumerateVThreads +
+                           ",notifyvthreads=" + notifyVThreads;
              // Quote only if necessary in case the quote arg value is bogus
              if (hasWhitespace(xrun)) {
                  xrun = quote + xrun + quote;
              }
  
< prev index next >