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

JDWP: classesByName reports class that hasn't been prepared

XMLWordPrintable

    • ladybird
    • x86
    • windows_nt
    • Not verified



        Name: pa48320 Date: 09/05/2000

        I'm using jdk1.3.0C.

        Problem:
        I'm debugging a class (application) that contains inner classes. I start the debugger and stop on the first line of main. I attempt to set a breakpoint in one of the inner classes of the class. VirtualMachine.classesByName(class$innerclass) returns a reference type for the inner class EVEN THOUGH I have not gotten a class prepared event for the inner class. Calling ReferenceType.locationsOfLine() on the inner class throws:

        com.sun.jdi.ClassNotPreparedException
        at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:36)
        at com.sun.tools.jdi.ReferenceTypeImpl.methods(ReferenceTypeImpl.java:353)
        at com.sun.tools.jdi.ReferenceTypeImpl.locationsOfLine(ReferenceTypeImpl.java:605)
        at com.sas.sdi.RemoteDebugger.setLineBreakpoint(RemoteDebugger.java:563)
        at com.sas.sdi.RemoteDebugger.setBreakpoint(RemoteDebugger.java:454)
        at com.sas.sdi.RemoteDebugger.setNewBreakpointOnVM(RemoteDebugger.java:428)
        at com.sas.sdi.RemoteDebugger.addBreakpoint(RemoteDebugger.java:969)

        Obviously, the last 4 lines are in my code.

        So, the reference type for the inner class is bogus somehow. Also, I can set a breakpoint on some of the other inner classes that I have in the same file (even though I have not gotten a class prepared event for them either).

        So, it seems like when the outer class gets loaded, one of the inner classes (the one that's causing the problem) gets partially loaded.

        1. How are inner classes supposed to work with regard to class preparation?
        2. The other inner classes that don't have problems haven't given me a classPrepared event either. Why do they work?

        Thanks,
        Ernest

        ======================================================================

              rfield Robert Field (Inactive)
              pallenba Peter Allenbach (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: