Skip to content

Commit 28b37f9

Browse files
get valid Frame from EvaluationContext
1 parent 3befe19 commit 28b37f9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Mono.Debugging.Soft/SoftDebuggerAdaptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ protected override ValueReference OnGetThisReference (EvaluationContext ctx)
12851285

12861286
static ValueReference GetThisReference (SoftEvaluationContext ctx)
12871287
{
1288-
return ctx.Frame.Method.IsStatic ? null : new ThisValueReference (ctx, ctx.Frame);
1288+
return ctx.Frame.Method.IsStatic ? null : new ThisValueReference (ctx);
12891289
}
12901290

12911291
public override ValueReference GetCurrentException (EvaluationContext ctx)

Mono.Debugging.Soft/ThisValueReference.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ namespace Mono.Debugging.Soft
3535
{
3636
public class ThisValueReference : ValueReference
3737
{
38-
readonly StackFrame frame;
3938
object type;
4039
Value value;
40+
private SoftEvaluationContext ctx;
4141

42-
public ThisValueReference (EvaluationContext ctx, StackFrame frame) : base (ctx)
42+
public ThisValueReference (SoftEvaluationContext ctx) : base (ctx)
4343
{
44-
this.frame = frame;
44+
this.ctx = ctx;
4545
}
4646

4747
public override ObjectValueFlags Flags {
@@ -55,14 +55,14 @@ public override string Name {
5555
public override object Value {
5656
get {
5757
if (value == null)
58-
value = frame.GetThis ();
58+
value = ctx.Frame.GetThis ();
5959

6060
return value;
6161
}
6262
set {
63-
if (frame.VirtualMachine.Version.AtLeast (2, 44)) {
63+
if (ctx.Frame.VirtualMachine.Version.AtLeast (2, 44)) {
6464
this.value = (Value)value;
65-
frame.SetThis ((Value)value);
65+
ctx.Frame.SetThis ((Value)value);
6666
}
6767
}
6868
}

0 commit comments

Comments
 (0)