Add setting to control the jdwp request timeout (#863)

* Add setting to control the jdwp request timeout

* Add the range constraint for the settings
This commit is contained in:
Jinbo Wang 2020-08-17 15:19:36 +08:00 committed by GitHub
parent 6ea8b9bd93
commit 766b602fc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 6 deletions

View File

@ -117,7 +117,8 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht
- `java.debug.settings.stepping.skipSynthetics`: Skip synthetic methods when stepping.
- `java.debug.settings.stepping.skipStaticInitializers`: Skip static initializer methods when stepping.
- `java.debug.settings.stepping.skipConstructors`: Skip constructor methods when stepping.
- `java.debug.settings.limitOfVariablesPerJdwpRequest`: The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout. Defaults to 100.
- `java.debug.settings.jdwp.limitOfVariablesPerJdwpRequest`: The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout. Defaults to 100.
- `java.debug.settings.jdwp.requestTimeout`: The timeout (ms) of JDWP request when the debugger communicates with the target JVM. Defaults to 3000.
Pro Tip: The documentation [Configuration.md](https://github.com/microsoft/vscode-java-debug/blob/master/Configuration.md) provides lots of samples to demonstrate how to use these debug configurations, recommend to take a look.

View File

@ -686,10 +686,17 @@
"description": "%java.debugger.launch.skipConstructors.description%",
"default": false
},
"java.debug.settings.limitOfVariablesPerJdwpRequest": {
"java.debug.settings.jdwp.limitOfVariablesPerJdwpRequest": {
"type": "number",
"description": "%java.debugger.configuration.limitOfVariablesPerJdwpRequest.description%",
"default": 100
"description": "%java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description%",
"default": 100,
"minimum": 1
},
"java.debug.settings.jdwp.requestTimeout": {
"type": "number",
"description": "%java.debugger.configuration.jdwp.requestTimeout.description%",
"default": 3000,
"minimum": 100
}
}
}

View File

@ -55,5 +55,6 @@
"java.debugger.configuration.forceBuildBeforeLaunch": "Force building the workspace before launching java program.",
"java.debugger.configuration.console": "The specified console to launch Java program. If you want to customize the console for a specific debug session, please modify the 'console' config in launch.json.",
"java.debugger.configuration.exceptionBreakpoint.skipClasses": "Skip the specified classes when breaking on exception. You could use the built-in variables such as '$JDK' and '$Libraries' to skip a group of classes, or add a specific class name expression, e.g. java.*, *.Foo",
"java.debugger.configuration.limitOfVariablesPerJdwpRequest.description": "The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout."
"java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description": "The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout.",
"java.debugger.configuration.jdwp.requestTimeout.description": "The timeout (ms) of JDWP request when the debugger communicates with the target JVM."
}

View File

@ -54,5 +54,6 @@
"java.debugger.configuration.forceBuildBeforeLaunch": "在启动java程序之前强制编译整个工作空间。",
"java.debugger.configuration.console": "指定的控制台用于启动Java程序。如果要为特定的调试会话自定义控制台请修改launch.json中的“console”配置。",
"java.debugger.configuration.exceptionBreakpoint.skipClasses": "当发生异常时,跳过指定的类。你可以使用内置变量,如'$JDK'和'$Libraries'来跳过一组类或者添加一个特定的类名表达式如java.**.Foo。",
"java.debugger.configuration.limitOfVariablesPerJdwpRequest.description": "一次JDWP请求中可以请求的变量或字段的最大数量。该值越高在展开变量视图时请求debuggee的频率就越低。同时数量过大也会导致JDWP请求超时。"
"java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description": "一次JDWP请求中可以请求的变量或字段的最大数量。该值越高在展开变量视图时请求debuggee的频率就越低。同时数量过大也会导致JDWP请求超时。",
"java.debugger.configuration.jdwp.requestTimeout.description": "调试器与目标JVM通信时JDWP请求的超时时间ms。"
}

View File

@ -558,6 +558,8 @@ async function updateDebugSettings(event?: vscode.ConfigurationChangeEvent) {
stepFilters,
exceptionFilters,
exceptionFiltersUpdated: event && event.affectsConfiguration("java.debug.settings.exceptionBreakpoint.skipClasses"),
limitOfVariablesPerJdwpRequest: Math.max(debugSettingsRoot.settings.jdwp.limitOfVariablesPerJdwpRequest, 1),
jdwpRequestTimeout: Math.max(debugSettingsRoot.settings.jdwp.requestTimeout, 100),
}));
if (logLevel === "FINE") {
// tslint:disable-next-line:no-console