-
Bug
-
Resolution: Fixed
-
P4
-
1.1.5
-
b01
-
x86
-
windows_95
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2018618 | 1.2.0 | Gordon Hirsch | P4 | Closed | Fixed | 1.2beta4 |
Name: chT40241 Date: 01/13/98
The stepOut method used by the debugger Agent for the jdb "step up"
command terminates prematurely. If an exception occurs in a descendant of the method being stepped out of, the "step up" terminates even if the debugger user has not asked to "catch" the exception and the exception is handled at a lower level than the method being stepped out of. In this case, the exception should be ignored by the agent.
For example, run the following program (StepOutDemo.java) under jdb:
public class StepOutDemo {
public static void main(String args[]) throws Exception {
level1();
}
static void level1() throws Exception {
int i = 5;
level2(i);
}
static void level2(int i) throws Exception {
try {
if (i > 0) throw new Exception("Hiccup");
} catch(Exception e) {
if (!e.getMessage().equals("Hiccup"))
throw e;
System.out.println("Excuse me...");
}
}
}
Here is a transcript of using jdb to step out of the "level1" method:
Initializing jdb...
0xf9e6d8:class(StepOutDemo)
> stop in StepOutDemo.level1
Breakpoint set in StepOutDemo.level1
> run
run StepOutDemo
running ...
main[1]
Breakpoint hit: StepOutDemo.level1 (StepOutDemo:6)
main[1] step up
main[1]
Breakpoint hit: StepOutDemo.level2 (StepOutDemo:12)
main[1] where
[1] StepOutDemo.level2 (StepOutDemo:12)
[2] StepOutDemo.level1 (StepOutDemo:7)
[3] StepOutDemo.main (StepOutDemo:3)
[4] sun.tools.debug.MainThread.run (MainThread:55)
Correct behavior would have been for StepOutDemo to have continued
execution to line 4 of StepOutDemo.main, writing the message "Excuse
me" in the process.
We have a fix for this problem, which I will send separately due to the
temdency of the bug entry process to misformat code.
======================================================================
- backported by
-
JDK-2018618 jdb step up command terminates prematurely after exception
-
- Closed
-