Skip to content

Commit 909ab61

Browse files
authored
Fix issue when poping the top stack frame from a thread. (microsoft#142)
1 parent 292d2da commit 909ab61

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/StackFrameUtility.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import com.sun.jdi.AbsentInformationException;
1515
import com.sun.jdi.IncompatibleThreadStateException;
16+
import com.sun.jdi.InvalidStackFrameException;
1617
import com.sun.jdi.ReferenceType;
1718
import com.sun.jdi.StackFrame;
1819

@@ -27,15 +28,13 @@ public static boolean isNative(StackFrame frame) {
2728
*
2829
* @param frame
2930
* the StackFrame will be popped
30-
* @return true if succeeded
3131
*/
32-
public static boolean pop(StackFrame frame) {
32+
public static void pop(StackFrame frame) throws DebugException {
3333
try {
3434
frame.thread().popFrames(frame);
35-
} catch (IncompatibleThreadStateException e) {
36-
return false;
35+
} catch (IncompatibleThreadStateException | InvalidStackFrameException e) {
36+
throw new DebugException(e.getMessage(), e);
3737
}
38-
return true;
3938
}
4039

4140
public static String getName(StackFrame frame) {

0 commit comments

Comments
 (0)