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

Commit 7791e3a

Browse files
author
Simon Priest
committed
Evaluate should use the frame specified by frameId
1 parent a337ea8 commit 7791e3a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
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)