java 跳过断点,因为它发生在调试器评估中 - Intellij IDEA
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47866398/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Skipped breakpoint because it happened inside debugger evaluation - Intellij IDEA
提问by Roman Khomyshynets
When I try to pick a breakpoint on any executive line of any method of my project, and I know that this method should be invoked for example 4 times, Intellij skips this breakpoint for 3 times and stops only on the last invocation. Method example (Endpoint class):
当我尝试在我的项目的任何方法的任何执行线上选择一个断点时,并且我知道该方法应该被调用 4 次,Intellij 会跳过这个断点 3 次并且仅在最后一次调用时停止。方法示例(端点类):
@PayloadRoot(localPart = "getRelatedCIs", namespace = "http://www.projectname.com/ws")
public GetRelatedCIsResponse getRelatedCIs(GetRelatedCIs request) throws DataAccessException, WebServiceException {
GetRelatedCIsResponse response = new GetRelatedCIsResponse();
PageData page = request.getPageData();
List<ConfigItemReference> ciRefs = translateCiRefList(request.getCiRef());
RelatedCiResult relatedCis = configItemService.getRelatedCis(ciRefs, request.getRequestedType(),
new Page(page.getPageNumber(), page.getPageSize(), page.getTotal()), request.getSort());
response.getCis().addAll(relatedCis.getCis());
page.setTotal(relatedCis.getPageInfo().getTotal());
page.setPageSize(relatedCis.getPageInfo().getPageSize());
response.setPageData(page);
System.out.println("****************************INVOCATION***************************" + request.getRequestedType());
return response;
}
Breakpoint is picked on the first line of the method. When program is stopped, there are already printed in console 3 lines ****************************INVOCATION***************************
在方法的第一行选择断点。当程序停止时,控制台中已经打印了 3 行 ****************************INVOCATION******** *******************
In the left bottom part of the screen appears green notification:
在屏幕的左下方出现绿色通知:
Skipped breakpoint at %code reference% because it happened inside debugger evaluation
在 %code reference% 处跳过断点,因为它发生在调试器评估中
But I don't use any Evaluate Expression functionality when I perform debugging. Also there are my VM options of Run/Debug Configurations:
但是我在执行调试时不使用任何评估表达式功能。还有我的运行/调试配置的 VM 选项:
-XX:MaxPermSize=512m
-Xms256m
-Xmx1024m
-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.port=9004
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
回答by Egor
The problem is described in IDEA-43728and in the breakpoints documentation.
IDEA-43728和断点文档中描述了该问题。
In short, to avoid it use suspend thread (not all) breakpoint policy.
简而言之,为了避免它使用挂起线程(不是全部)断点策略。