< prev index next >

src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c

Print this page
@@ -300,10 +300,13 @@
      needed_capabilities.can_generate_method_exit_events         = 1;
      needed_capabilities.can_generate_garbage_collection_events  = 1;
      needed_capabilities.can_maintain_original_method_order      = 1;
      needed_capabilities.can_generate_monitor_events             = 1;
      needed_capabilities.can_tag_objects                         = 1;
+     if (gdata->vthreadsSupported) {
+         needed_capabilities.can_support_virtual_threads         = 1;
+     }
  
      /* And what potential ones that would be nice to have */
      needed_capabilities.can_force_early_return
                  = potential_capabilities.can_force_early_return;
      needed_capabilities.can_generate_field_modification_events

@@ -872,10 +875,12 @@
   "server=y|n                       listen for debugger?              n\n"
   "launch=<command line>            run debugger on event             none\n"
   "onthrow=<exception name>         debug on throw                    none\n"
   "onuncaught=y|n                   debug on any uncaught?            n\n"
   "timeout=<timeout value>          for listen/attach in milliseconds n\n"
+  "enumeratevthreads=y|n            thread lists include all vthreads n\n"
+  "notifyvthreads=y|n               send vthread START/END events     y\n"
   "mutf8=y|n                        output modified utf-8             n\n"
   "quiet=y|n                        control over terminal messages    n\n"));
  
      TTY_MESSAGE((
   "Obsolete Options\n"

@@ -1018,10 +1023,16 @@
      /* Set defaults */
      gdata->assertOn     = DEFAULT_ASSERT_ON;
      gdata->assertFatal  = DEFAULT_ASSERT_FATAL;
      logfile             = DEFAULT_LOGFILE;
  
+     /* Set vthread debugging level. */
+     gdata->vthreadsSupported = JNI_TRUE;
+     gdata->trackAllVThreads = JNI_FALSE;
+     gdata->enumerateVThreads = JNI_FALSE;
+     gdata->notifyVThreads = JNI_TRUE;
+ 
      /* Options being NULL will end up being an error. */
      if (options == NULL) {
          options = "";
      }
  

@@ -1120,10 +1131,35 @@
              if (!get_tok(&str, current, (int)(end - current), ',')) {
                  goto syntax_error;
              }
              currentTransport->timeout = atol(current);
              current += strlen(current) + 1;
+         } else if (strcmp(buf, "enumeratevthreads") == 0) {
+             if (!get_tok(&str, current, (int)(end - current), ',')) {
+                 goto syntax_error;
+             }
+             if (strcmp(current, "y") == 0) {
+                 gdata->enumerateVThreads = JNI_TRUE;
+             } else if (strcmp(current, "n") == 0) {
+                 gdata->enumerateVThreads = JNI_FALSE;
+             } else {
+                 goto syntax_error;
+             }
+             gdata->trackAllVThreads = gdata->enumerateVThreads;
+             current += strlen(current) + 1;
+         } else if (strcmp(buf, "notifyvthreads") == 0) {
+             if (!get_tok(&str, current, (int)(end - current), ',')) {
+                 goto syntax_error;
+             }
+             if (strcmp(current, "y") == 0) {
+                 gdata->notifyVThreads = JNI_TRUE;
+             } else if (strcmp(current, "n") == 0) {
+                 gdata->notifyVThreads = JNI_FALSE;
+             } else {
+                 goto syntax_error;
+             }
+             current += strlen(current) + 1;
          } else if (strcmp(buf, "launch") == 0) {
              /*LINTED*/
              if (!get_tok(&str, current, (int)(end - current), ',')) {
                  goto syntax_error;
              }
< prev index next >