fix the bug that the current line number for the calling frame is off by one
This commit is contained in:
@@ -268,9 +268,10 @@ public class DebugStackState extends StackState implements DebugRequestListener
|
|||||||
*/
|
*/
|
||||||
private int getLineNumber(CallInfo ci) {
|
private int getLineNumber(CallInfo ci) {
|
||||||
int[] lineNumbers = ci.closure.p.lineinfo;
|
int[] lineNumbers = ci.closure.p.lineinfo;
|
||||||
int pc = ci.pc;
|
int pc = (ci != calls[cc] ? ci.pc - 1 : ci.pc);
|
||||||
int line = (lineNumbers != null && lineNumbers.length > pc ? lineNumbers[pc]
|
int line = (lineNumbers != null && lineNumbers.length > pc ?
|
||||||
: -1);
|
lineNumbers[pc] :
|
||||||
|
-1);
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -455,6 +456,11 @@ public class DebugStackState extends StackState implements DebugRequestListener
|
|||||||
return frames;
|
return frames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the visible local variables on a stack frame.
|
||||||
|
* @param index The stack frame index
|
||||||
|
* @return the visible local variables on the given stack frame.
|
||||||
|
*/
|
||||||
public Variable[] getStack(int index) {
|
public Variable[] getStack(int index) {
|
||||||
if (index < 0 || index >= calls.length) {
|
if (index < 0 || index >= calls.length) {
|
||||||
throw new RuntimeException("invalid stack index");
|
throw new RuntimeException("invalid stack index");
|
||||||
|
|||||||
Reference in New Issue
Block a user