Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 544e2b9

Browse files
authored
Merge pull request #116 from spriest487/master
Fix for evaluating variables in stack frames other than the top one
2 parents 277dda6 + c413bc6 commit 544e2b9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

UnityDebug/UnityDebugSession.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,20 +800,22 @@ public override void Threads(Response response, dynamic args)
800800
public override void Evaluate(Response response, dynamic args)
801801
{
802802
var expression = GetString(args, "expression");
803+
var frameId = GetInt(args, "frameId", 0);
803804

804805
if (expression == null)
805806
{
806807
SendError(response, "expression missing");
807808
return;
808809
}
809810

810-
if (Frame == null)
811+
var frame = m_FrameHandles.Get(frameId, null);
812+
if (frame == null)
811813
{
812814
SendError(response, "no active stackframe");
813815
return;
814816
}
815817

816-
if (!Frame.ValidateExpression(expression))
818+
if (!frame.ValidateExpression(expression))
817819
{
818820
SendError(response, "invalid expression");
819821
return;
@@ -822,7 +824,7 @@ public override void Evaluate(Response response, dynamic args)
822824
var evaluationOptions = m_DebuggerSessionOptions.EvaluationOptions.Clone();
823825
evaluationOptions.EllipsizeStrings = false;
824826
evaluationOptions.AllowMethodEvaluation = true;
825-
var val = Frame.GetExpressionValue(expression, evaluationOptions);
827+
var val = frame.GetExpressionValue(expression, evaluationOptions);
826828
val.WaitHandle.WaitOne();
827829

828830
var flags = val.Flags;

0 commit comments

Comments
 (0)