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

"step over" after a class is redefined acts like "step out"

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.4.0, 1.4.1
    • Fix Version/s: 1.4.2
    • Component/s: core-svc
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      generic, sparc
    • OS:
      solaris_8

      Description

      After a class is redefined, subsequent jdb operation "next" (step over) acts like "step up" (return to a method's caller).

      To reproduce;

      1) Compile the following Java class:

      public class Test {
          
          public static void main(String[] args) {
              System.out.println("--A");
              minor();
              System.out.println("--Z");
          }
          
          public static void minor() {
              System.out.println("1");
              System.out.println("2");
              System.out.println("3");
              System.out.println("4");
              System.out.println("5");
          }
          
      }

      2) Run 'jdb'.
      3) Set a breakpoint on line with 'println("3")'.
      4) Run the class inside 'jdb'.
      5) When the breakpoint is hit, slightly modify source
         code of method 'minor()' (e.g. replace "1" with "10")
         and compile the class again.
      6) Redefine the class in 'jdb'.
      7) Perform operation 'next'.
      'jdb' will perform 'step up' instead.

      Output from 'jdb':

      =============================================================
      bash-2.03$ $HOPPER_HOME/bin/jdb
      Initializing jdb ...
      > stop in Test:12
      Deferring breakpoint Test:12.
      It will be set after the class is loaded.
      > run Test
      run Test
      Set uncaught java.lang.Throwable
      Set deferred uncaught java.lang.Throwable
      >
      VM Started: Set deferred breakpoint Test:12
      --A
      1
      2

      Breakpoint hit: "thread=main", Test.minor(), line=12 bci=16
      12 System.out.println("3");

      main[1] redefine Test Test.class
      main[1] next
      > 3
      4
      5

      Step completed: "thread=main", Test.main(), line=6 bci=11
      6 System.out.println("--Z");

      main[1] next
      > --Z

      Step completed: "thread=main", Test.main(), line=7 bci=19
      7 }

      main[1] next
      >
      The application exited
      =====================================================================

      Tested on:
      - RedHat Linux 7.1, JDK 1.4.1 beta
      - Solaris 8, JDK 1.4.0
      - Solaris 8, JDK 1.4.1 beta

      ###@###.### 2002-05-22

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                swamyv Swamy Venkataramanappa
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: