Any time user want to evaluate variable or change value, jdb will restore functions stack.
class FunctionStack {
static int amountOfCalls;
FunctionStack (int _amountOfCalls) {
amountOfCalls = _amountOfCalls;
}
int MakeStack(int stLevel) {
if (stLevel < amountOfCalls)
this.MakeStack(++stLevel);
System.out.println("Level: " + stLevel);
return stLevel;
}
public static void main(String args[]) {
FunctionStack fs = new FunctionStack(20);
fs.MakeStack(0);
}
}
To reproduce:
stop at FunctionStack:14
run FunctionStack
where
up
up
up
up
where
eval stLevel
where
class FunctionStack {
static int amountOfCalls;
FunctionStack (int _amountOfCalls) {
amountOfCalls = _amountOfCalls;
}
int MakeStack(int stLevel) {
if (stLevel < amountOfCalls)
this.MakeStack(++stLevel);
System.out.println("Level: " + stLevel);
return stLevel;
}
public static void main(String args[]) {
FunctionStack fs = new FunctionStack(20);
fs.MakeStack(0);
}
}
To reproduce:
stop at FunctionStack:14
run FunctionStack
where
up
up
up
up
where
eval stLevel
where
- duplicates
-
JDK-4296031 TTY: jdb loses track of current stack frame after print/dump
- Closed