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

JDI: Location.codeIndex() for native method does not return -1.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-svc
    • None
    • generic
    • generic


       API documentation for Location.codeIndex states that it returns " the long
       representing the position within the method, or -1 if the method is native."
       
       As the location will be null for abstract and native methods
       Location.codeIndex() will not return -1 for a native method.
       
       Scenario:
       ---------
       Debugger - LocationTest.java
       Debugee - LocationDebugee.java
       
       As mentioned in Locatable API "abstract and native Methods will return null
       when their location method is called." the native method "nativeMethod()"
       in LocationDebugee returns null when the location() method is called.
       Calling codeIndex() on this location null throws NullPointerException.
         
       ***Testing done in JDK1.3.0rc2-Y-Hotspot and Classic VM(WinNT and Solaris2.7)

       Steps to reproduce the bug
       ---------------------------
       The bug can be reproduced using the files in the location
       /net/sqesvr/export/disk5/toolsbugs/4325270
       Follow the instructions in README to reproduce the bug.

            rfield Robert Field (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: