United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4689395 : "step over" after a class is redefined acts like "step out"

Details
Type:
Bug
Submit Date:
2002-05-22
Status:
Resolved
Updated Date:
2003-04-12
Project Name:
JDK
Resolved Date:
2002-09-02
Component:
core-svc
OS:
solaris_8
Sub-Component:
debugger
CPU:
sparc,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.0,1.4.1
Fixed Versions:
1.4.2 (mantis)

Related Reports
Duplicate:
Relates:

Sub Tasks

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

                                    

Comments
EVALUATION

Problem is in the back end code which controls the STEP_LINE/STEP_OVER
mechanism. When line number info is missing STEP_LINE/STEP_OVER was 
not enabling the stepping. So need to fix the logic in back end to
enable stepping.
                                     
2004-06-11
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mantis
mantis-b02

FIXED IN:
mantis
mantis-b02

INTEGRATED IN:
mantis
mantis-b02


                                     
2004-06-14



Hardware and Software, Engineered to Work Together