0

Here is the test code :

import java.util.HashMap;
import java.util.Map;

public class Tester {
    public static void main(String[] args) {
        Map<String, Integer> map = new HashMap<String, Integer>();
        map.put("ABC", 1); //breakpoint here
    }
}

Normally in debug mode, when mouse is hovering above certain variable, the value is displayed. But it seems most of the variables in HashMap does not display its value when mouse hovers.

In the put method of HashMap, most of the members of map get evaluation errors: enter image description here

Why are there so many <error(s)_during_the_evaluation>? what caused these errors?

CDT
  • 10,165
  • 18
  • 66
  • 97
  • You're in the "Expressions" tab, try removing the `"` at the beginning and end (`hash` instead of `"hash"` for example). – Tunaki Oct 10 '15 at 11:01
  • @Tunaki the `"` is added by default, it cannot be removed. – CDT Oct 10 '15 at 11:06

1 Answers1

1

The reason beyond that is that the bytecode (.class files) used by your Eclipse debugger doesn't contain any information about method parameters name. That's the way the JDK is compiled by default.

The Eclipse debugger implements a workaround for method parameters, naming them "arg0", "arg1", etc. and thus enabling you to inspect them in the "Variables" view. Unfortunately, I don't think there is such a workaround for local method variables...

Some other tickets in StackOverflow advise to rebuild yourself the JRE based on source code of the JDK, e.g.: debugging not able to inspect the variables.

Community
  • 1
  • 1
dosyfier
  • 318
  • 2
  • 8