mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[memory-agent] IDEA-209121 Running tests in debugger broken on non Linux/Mac/Windows
Do not try to attach memory agent on unsupported platforms
This commit is contained in:
@@ -69,10 +69,11 @@ public class MemoryAgentUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
//if(isOsSupported()) {
|
||||
// LOG.info(SystemInfo.);
|
||||
//
|
||||
//}
|
||||
if (isPlatformSupported()) {
|
||||
LOG.warn("Could not use memory agent on current OS.");
|
||||
DebuggerSettings.getInstance().ENABLE_MEMORY_AGENT = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (isIbmJdk(parameters)) {
|
||||
LOG.info("Do not attach memory agent for IBM jdk");
|
||||
@@ -165,6 +166,10 @@ public class MemoryAgentUtil {
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isPlatformSupported() {
|
||||
return SystemInfo.isWindows || SystemInfo.isMac || SystemInfo.isLinux;
|
||||
}
|
||||
|
||||
private static boolean isIbmJdk(@NotNull JavaParameters parameters) {
|
||||
Sdk jdk = parameters.getJdk();
|
||||
String vendor = jdk == null ? null : JdkUtil.getJdkMainAttribute(jdk, Attributes.Name.IMPLEMENTATION_VENDOR);
|
||||
@@ -187,6 +192,7 @@ public class MemoryAgentUtil {
|
||||
}
|
||||
|
||||
private static AgentExtractor.AgentLibraryType detectAgentKind(String jdkPath) {
|
||||
LOG.assertTrue(isPlatformSupported());
|
||||
if (SystemInfo.isLinux) return AgentExtractor.AgentLibraryType.LINUX;
|
||||
if (SystemInfo.isMac) return AgentExtractor.AgentLibraryType.MACOS;
|
||||
JdkVersionDetector.JdkVersionInfo versionInfo = JdkVersionDetector.getInstance().detectJdkVersionInfo(jdkPath);
|
||||
|
||||
+4
-1
@@ -2,6 +2,7 @@
|
||||
package com.intellij.debugger.settings;
|
||||
|
||||
import com.intellij.debugger.DebuggerBundle;
|
||||
import com.intellij.debugger.memory.agent.MemoryAgentUtil;
|
||||
import com.intellij.openapi.options.ConfigurableUi;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
@@ -106,7 +107,9 @@ class DebuggerLaunchingConfigurable implements ConfigurableUi<DebuggerSettings>
|
||||
panel.add(myCbDisableJIT);
|
||||
panel.add(myCbShowAlternativeSource);
|
||||
panel.add(myCbKillImmediately);
|
||||
panel.add(myCbEnableMemoryAgent);
|
||||
if (MemoryAgentUtil.isPlatformSupported()) {
|
||||
panel.add(myCbEnableMemoryAgent);
|
||||
}
|
||||
if (Registry.is("execution.java.always.debug")) {
|
||||
panel.add(myCbAlwaysDebug);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user