From 01026854dfcf4873e62effc893ddaa17ad0404c4 Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Fri, 21 Jun 2024 11:01:20 +0200 Subject: [PATCH] Display rethrow stack in variables --- src/HLAdapter.hx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/HLAdapter.hx b/src/HLAdapter.hx index 25c3cc5..7fb559a 100644 --- a/src/HLAdapter.hx +++ b/src/HLAdapter.hx @@ -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(); @@ -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); } @@ -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, }); }