Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4270488

JDWP: Step over some native method calls never completes.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.0
    • 1.2.2
    • core-svc
    • kestrel
    • generic
    • generic
    • Not verified

      When stepping over a native method which calls a Java method, the step never completes and the application runs to completion (or to the next event). This can be seen in JDK 1.2.2 with the following debuggee:

      package untitled5;


      public class untitled5 {

        public static void main(String[] args) {
          String xyz = "abc";
          Object obj = xyz;

          Class clazz = obj.getClass();

          //String toString = clazz.toString(); // uncomment this line if you want to avoid the problem
          String clazzName = clazz.getName(); // put breakpoint here, and step-over
          int shouldbeHere = 0; // it should have stopped here !!
          if (shouldbeHere >= 0) {
            System.out.println("abc");
          }

        }
      }

      Class.getName is a native method which, on its first call, will call a java method (String constructor). When stepping over the call in the example above, the app runs to completion. Note that getName() only calls a java method on its first invocation under 1.2.2. Under 1.3, this particular test case doesn't fail, but it should be easy to construct another that will, since the code in this area is unchanged.

            ghirschsunw Gordon Hirsch (Inactive)
            ghirschsunw Gordon Hirsch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: