Skip to content

Commit cc00591

Browse files
committed
add option for enabling includevirtualthreads
1 parent 3489261 commit cc00591

4 files changed

Lines changed: 30 additions & 12 deletions

File tree

‎java-debugger-api/src/main/resources/LOCALIZE-LIB/en_US/com.intellij.java.debugger.JavaDebuggerLocalize.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,8 @@ label.get.jpda.dialog.prompt:
723723
text: To get JPDA libraries please visit
724724
label.group.watch.events:
725725
text: Watch
726+
label.include.virtual.threads.as.platform.threads:
727+
text: List of all threads includes virtual threads as well as platform threads
726728
label.method.breakpoint.properties.panel.emulated:
727729
text: Em&ulated
728730
label.method.breakpoint.properties.panel.method.entry:

‎java-debugger-impl/src/main/java/com/intellij/java/debugger/impl/DebuggerManagerImpl.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,12 @@ public static RemoteConnection createDebugParameters(
409409
debuggeeRunProperties += ",suspend=n,server=y";
410410
}
411411

412+
DebuggerSettings settings = DebuggerSettings.getInstance();
413+
414+
if (settings.INCLUDE_VIRTUAL_THREADS) {
415+
debuggeeRunProperties += ",includevirtualthreads=y";
416+
}
417+
412418
if (StringUtil.containsWhitespaces(debuggeeRunProperties)) {
413419
debuggeeRunProperties = "\"" + debuggeeRunProperties + "\"";
414420
}

‎java-debugger-impl/src/main/java/com/intellij/java/debugger/impl/settings/DebuggerSettings.java‎

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public class DebuggerSettings implements Cloneable, PersistentStateComponent<Ele
8989
public boolean SKIP_CONSTRUCTORS;
9090
public boolean SKIP_GETTERS;
9191
public boolean SKIP_CLASSLOADERS = true;
92+
public boolean INCLUDE_VIRTUAL_THREADS = false;
9293

9394
public String RUN_HOTSWAP_AFTER_COMPILE = RUN_HOTSWAP_ASK;
9495
public boolean COMPILE_BEFORE_HOTSWAP = true;
@@ -172,18 +173,23 @@ public boolean equals(Object obj) {
172173
}
173174
DebuggerSettings secondSettings = (DebuggerSettings) obj;
174175

175-
return TRACING_FILTERS_ENABLED == secondSettings.TRACING_FILTERS_ENABLED && DEBUGGER_TRANSPORT == secondSettings.DEBUGGER_TRANSPORT && StringUtil
176-
.equals(EVALUATE_FINALLY_ON_POP_FRAME,
177-
secondSettings.EVALUATE_FINALLY_ON_POP_FRAME) && SHOW_ALTERNATIVE_SOURCE ==
178-
secondSettings.SHOW_ALTERNATIVE_SOURCE && KILL_PROCESS_IMMEDIATELY == secondSettings.KILL_PROCESS_IMMEDIATELY && HOTSWAP_IN_BACKGROUND == secondSettings.HOTSWAP_IN_BACKGROUND &&
179-
SKIP_SYNTHETIC_METHODS == secondSettings.SKIP_SYNTHETIC_METHODS && SKIP_CLASSLOADERS == secondSettings.SKIP_CLASSLOADERS && SKIP_CONSTRUCTORS == secondSettings.SKIP_CONSTRUCTORS &&
180-
SKIP_GETTERS == secondSettings.SKIP_GETTERS && RESUME_ONLY_CURRENT_THREAD == secondSettings.RESUME_ONLY_CURRENT_THREAD && COMPILE_BEFORE_HOTSWAP == secondSettings
181-
.COMPILE_BEFORE_HOTSWAP && HOTSWAP_HANG_WARNING_ENABLED == secondSettings.HOTSWAP_HANG_WARNING_ENABLED && (RUN_HOTSWAP_AFTER_COMPILE != null ? RUN_HOTSWAP_AFTER_COMPILE
182-
.equals
183-
(secondSettings.RUN_HOTSWAP_AFTER_COMPILE) : secondSettings.RUN_HOTSWAP_AFTER_COMPILE == null) && DebuggerUtilsEx.filterEquals(
184-
mySteppingFilters,
185-
secondSettings.mySteppingFilters) &&
186-
myCapturePoints.equals(((DebuggerSettings) obj).myCapturePoints);
176+
return TRACING_FILTERS_ENABLED == secondSettings.TRACING_FILTERS_ENABLED
177+
&& DEBUGGER_TRANSPORT == secondSettings.DEBUGGER_TRANSPORT
178+
&& StringUtil.equals(EVALUATE_FINALLY_ON_POP_FRAME, secondSettings.EVALUATE_FINALLY_ON_POP_FRAME)
179+
&& SHOW_ALTERNATIVE_SOURCE == secondSettings.SHOW_ALTERNATIVE_SOURCE
180+
&& KILL_PROCESS_IMMEDIATELY == secondSettings.KILL_PROCESS_IMMEDIATELY
181+
&& HOTSWAP_IN_BACKGROUND == secondSettings.HOTSWAP_IN_BACKGROUND
182+
&& SKIP_SYNTHETIC_METHODS == secondSettings.SKIP_SYNTHETIC_METHODS
183+
&& SKIP_CLASSLOADERS == secondSettings.SKIP_CLASSLOADERS
184+
&& SKIP_CONSTRUCTORS == secondSettings.SKIP_CONSTRUCTORS
185+
&& SKIP_GETTERS == secondSettings.SKIP_GETTERS
186+
&& INCLUDE_VIRTUAL_THREADS == secondSettings.INCLUDE_VIRTUAL_THREADS
187+
&& RESUME_ONLY_CURRENT_THREAD == secondSettings.RESUME_ONLY_CURRENT_THREAD
188+
&& COMPILE_BEFORE_HOTSWAP == secondSettings.COMPILE_BEFORE_HOTSWAP
189+
&& HOTSWAP_HANG_WARNING_ENABLED == secondSettings.HOTSWAP_HANG_WARNING_ENABLED
190+
&& (RUN_HOTSWAP_AFTER_COMPILE != null ? RUN_HOTSWAP_AFTER_COMPILE.equals(secondSettings.RUN_HOTSWAP_AFTER_COMPILE) : secondSettings.RUN_HOTSWAP_AFTER_COMPILE == null)
191+
&& DebuggerUtilsEx.filterEquals(mySteppingFilters, secondSettings.mySteppingFilters)
192+
&& myCapturePoints.equals(((DebuggerSettings) obj).myCapturePoints);
187193
}
188194

189195
@Override

‎java-debugger-impl/src/main/java/com/intellij/java/debugger/impl/settings/NewDebuggerLaunchingConfigurable.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ protected Component createLayout(PropertyBuilder propertyBuilder, Disposable dis
5757
layout.add(LabeledBuilder.sided(JavaDebuggerLocalize.labelDebuggerLaunchingConfigurableDebuggerTransport(), transportBox));
5858
propertyBuilder.add(transportBox, () -> settings.DEBUGGER_TRANSPORT, it -> settings.DEBUGGER_TRANSPORT = it);
5959

60+
CheckBox includeVirtualThreadsBox = CheckBox.create(JavaDebuggerLocalize.labelIncludeVirtualThreadsAsPlatformThreads());
61+
layout.add(includeVirtualThreadsBox);
62+
propertyBuilder.add(includeVirtualThreadsBox, () -> settings.INCLUDE_VIRTUAL_THREADS, it -> settings.INCLUDE_VIRTUAL_THREADS = it);
63+
6064
return layout;
6165
}
6266
}

0 commit comments

Comments
 (0)