【问题标题】:Eclipse debugger not working ( Skip breakpoints disabled )Eclipse 调试器不工作(跳过断点已禁用)
【发布时间】:2020-09-15 19:48:45
【问题描述】:

这是我第一次运行调试器来检查我的二叉搜索树的值,但它似乎跳过了所有调试器,并且在蓝点旁边有一个奇怪的箭头。顺便说一句,我确定了跳过所有断点已禁用。

这是我运行程序的简短 GIF https://gyazo.com/e236c1bd75ac746bf9982871ca847233

添加了我的其他课程

public class BinaryTree<T extends Comparable<T>> {

private class Node{

    private T data;
    private Node left;
    private Node right;

    // left and right child do not have to nessary exist
    public Node ( T data) {
        this.data = data;
        this.left = null;
        this.right = null; 
    }}

    private Node root;
    private int count = 0;

    public void add( T data) {
        if ( isEmpty()) {
            root = new Node(data);
            count++;
        }
        else {
            insert(data, root);
            count++;
        }
    }

    public boolean isEmpty() {  
        return root == null;
    }

    public T getRoot()  {
        if ( root.data == null) {
            System.out.println("Root is empty");
            return null;
        }
        else {
        return  root.data;
    }}

    /*
     * Checking if the data is larger or lesser than the parent's data
     * If the data is smaller than the parent's data, node.left is created 
     * If the data is bigger than the parent's data, node.right is created
     */
    private void insert( T data, Node node) {

        /*
         * If 1st obj is less than the 2nd obj return a neg
         * if 1st obj is more than the 2nd obj return a pos
         * if equal return 0
         */
        int compare = data.compareTo(node.data);
        if ( compare < 1 ){
            if (node.left == null ) {
                node.left = new Node(data);

            }

        // make node.left if it is filled   
            else {
                insert(data, node.left);
            }
        }

        else {
            if ( node.right == null) {
                node.right = new Node(data);
            }
            else {
                insert( data, node.right);
            }
        }
    }

    public int getSize() {
        return count;
    }

    private void removeInner( T data, Node node ) {

    Node temp;
    while ( node.data!=data) {
        int compare = data.compareTo(node.data);

        if ( compare < 1 ){
            node = node.left;
        }
        // make node.left if it is filled   
        if ( compare > 1 ){
            node = node.right;
            }

        if ( compare == 0) {
            node = null;
        }


        }


    }

}

【问题讨论】:

  • 您是否使用 Debug 而不是 Run 来启动您的应用程序?
  • @nitind 是的,真的什么都没弹出
  • 也许尝试重新安装 eclipse,不是你想听到的,但从长远来看可能是最简单的方法!
  • 您使用哪个 JRE 运行它? Eclipse 是在编译类还是外部工具?你能删除并重置断点吗?
  • @nitind 适用于 Java 开发人员的 Eclipse IDE 版本:2020-03 (4.15.0) 构建 ID:20200313-1211 jdk-14.0.1 不确定您所说的重置是什么意思。我可以删除它。我不太确定编译问题,但它应该是编译类。我没有使用任何外部工具

标签: java eclipse debugging


【解决方案1】:

您在其他地方有一个或多个所谓的触发点(用T 装饰),必须首先点击才能激活另一个常规断点。这可以从第 9 行中的常规 断点 中看出,并用划掉的T 装饰。

解决方案:删除或停用所有触发点(带有T 装饰的触发点),例如在 断点 视图中。

【讨论】:

  • 你的意思是其他班级有问题?那不允许代码正常运行?
  • 我的断点属性中的触发点选项被禁用。唯一的复选框票已启用
  • @Fenzox 第 9 行的断点不会激活,因为触发点所在的行(在不同的文件中)没有执行。
  • 该功能已激活,二叉树的大小确实增加了,我没有收到任何错误
  • @Fenzox 第 9 行的断点是常规断点。但是在其他地方(不在显示的文件中)有一个或多个触发点,必须删除、停用或变成常规断点。
猜你喜欢
  • 2010-12-13
  • 2020-01-27
  • 2013-06-08
  • 1970-01-01
  • 2016-12-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多