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

Fix for evaluating variables in stack frames other than the top one #116

Merged
merged 2 commits into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MonoDevelop.Debugger.Soft.Unity
8 changes: 5 additions & 3 deletions UnityDebug/UnityDebugSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -800,20 +800,22 @@ public override void Threads(Response response, dynamic args)
public override void Evaluate(Response response, dynamic args)
{
var expression = GetString(args, "expression");
var frameId = GetInt(args, "frameId", 0);

if (expression == null)
{
SendError(response, "expression missing");
return;
}

if (Frame == null)
var frame = m_FrameHandles.Get(frameId, null);
if (frame == null)
{
SendError(response, "no active stackframe");
return;
}

if (!Frame.ValidateExpression(expression))
if (!frame.ValidateExpression(expression))
{
SendError(response, "invalid expression");
return;
Expand All @@ -822,7 +824,7 @@ public override void Evaluate(Response response, dynamic args)
var evaluationOptions = m_DebuggerSessionOptions.EvaluationOptions.Clone();
evaluationOptions.EllipsizeStrings = false;
evaluationOptions.AllowMethodEvaluation = true;
var val = Frame.GetExpressionValue(expression, evaluationOptions);
var val = frame.GetExpressionValue(expression, evaluationOptions);
val.WaitHandle.WaitOne();

var flags = val.Flags;
Expand Down