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

TTY: redefine class clears breakpoints but clear still lists breakpoints

XMLWordPrintable

    • generic, sparc
    • generic, solaris_7


      In the JVMDI spec RedefineClasses is specified to clear all breakpoints
      in the class. However after redefining a class, jdb's 'clear' command
      reports breakpoints that it previously recorded. This is confusing
      for developers. I attached test case which I need to put into the regssionsInWaiting area.

      Fixing this issue completely probably requies that jdb become class
      loader aware (4519542) so as to ensure that the correct breakpoints are
      removed from the jdb environment.


      #!/bin/sh
      # @test %W% %E%
      # @bug 12345678
      # @summary TTY: redefine class clears breakpoints but clear still
      # lists breakpoints
      #
      # @run shell RedefineClearBreakpoints.sh

      compileOptions=-g
      compileOptions2=-g

      # Uncomment this to see the JDI trace
      #jdbOptions=-dbgtrace

      createJavaFile()
      {
          cat <<EOF > $1.java.1

      public class $1 {

          public static void main(String args[]) {
              System.out.println("a message"); // @1 breakpoint
          }
      }
      EOF
      }

      # This is called to feed cmds to jdb.
      dojdbCmds()
      {
          setBkpts @1
          runToBkpt @1
          redefineClass @1
          cmd where
          cmd cont
          cmd quit
      }


      mysetup()
      {
          if [ -z "$TESTSRC" ] ; then
              TESTSRC=.
          fi

          for ii in . $TESTSRC $TESTSRC/.. ; do
              if [ -r "$ii/ShellScaffold.sh" ] ; then
                  . $ii/ShellScaffold.sh
                  break
              fi
          done
      }

      # You could replace this next line with the contents
      # of ShellScaffold.sh and this script will run just the same.
      mysetup

      runit

      jdbFailIfNotPresent 'No breakpoints set'
      pass

            Unassigned Unassigned
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: