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

STD: Can't set a breakpoint in a static initializer

    XMLWordPrintable

Details

    • beta
    • x86, sparc
    • solaris_2.5.1, windows_nt
    • Not verified

    Description

      A class may have static member that are initialized. The
      code for the initialization is collected into a function
      known as a class initializer and given the name "<clinit>".

      You can't set a breakpoint in the "<clinit>" routine.
      The problem is that code field of the method block for the "<clinit>"
      function is set to zero. This field is suppose to contain the
      starting pc address for the "<clinit>" method.

      The code for the <clinit> method is read into a separate buffer from
      the rest of a class's code. This is because the <clinit> code
      can only be executed once and is then discarded. This effectively
      means we can't set a breakpoint in <clinit> because the code doesn't
      stay around.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: