gpt4 book ai didi

java - Eclipse 中搜索结果的断点

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:20:55 26 4
gpt4 key购买 nike

我想通过在搜索结果上放置断点来调试我的程序。

因为我有大约 1000 场比赛,我希望有一种简单快速的方法来做到这一点。

最佳答案

您可以做的是生成包含您需要的所有断点的 Eclipse xml 文件。

只需右键单击断点选项卡并选择Expoert Breakpoints...

保存文件,以编程方式对其进行编辑,然后将其导回。

编写此类文件的简单示例:

    Map<String, Integer> breakPointsLocation = new HashMap<>();
// some logic to fill this hashmap based on your search results (you can use grep)

// header
System.out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
System.out.println("<breakpoints>");
for (Entry<String, Integer> entry: breakPointsLocation.entrySet())
{
System.out.println("<breakpoint enabled=\"true\" persistant=\"true\" registered=\"true\">");
System.out.println("<resource path=\"" + entry.getKey() + "\" type=\"1\"/>");
System.out.println("<marker charStart=\"1317\" lineNumber=\"" + entry.getValue() + "\" type=\"org.eclipse.jdt.debug.javaLineBreakpointMarker\">");
System.out.println("<attrib name=\"charStart\" value=\"1317\"/>");
// add some more attrbiutes here
System.out.println("</marker>");
System.out.println("</breakpoint>");
}

//footer
System.out.println("</breakpoints>");

关于java - Eclipse 中搜索结果的断点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29336540/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com