Skip to content

Commit

Permalink
Display rethrow stack in variables
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Jun 21, 2024
1 parent 5c257e7 commit 0102685
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/HLAdapter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,6 @@ class HLAdapter extends DebugSession {
default: dbg.eval.valueStr(exc);
};
debug("Exception: " + str);
var bt = dbg.getVMExceptionStack();
if( bt != null )
trace("Rethrow from " + bt.map(f -> '${f.file}:${f.line}(${stackStr(f)})'));
}

syncThreads();
Expand Down Expand Up @@ -653,6 +650,13 @@ class HLAdapter extends DebugSession {
errorMessage(e);
}
}
var exception = dbg.getVMExceptionStack();
if( exception != null )
response.body.scopes.push({
name : "Exception Stack",
variablesReference : allocValue(VStack(exception)),
expensive : false,
});
sendResponse(response);
}

Expand Down Expand Up @@ -858,7 +862,7 @@ class HLAdapter extends DebugSession {
var st = stack[i];
vars.push({
name : ""+i,
value : st.file+":"+st.line+(st.context == null ? "" : " ("+st.context.obj.name+"."+st.context.field+")"),
value : (st.context == null ? "" : st.context.obj.name + "." + st.context.field) + " (" + getFilePath(st.file) + ":" + st.line + ")",
variablesReference: 0,
});
}
Expand Down

0 comments on commit 0102685

Please sign in to comment.