Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/debugger-libs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaruka Matsumoto <harukam0416@gmail.com>2017-08-23 14:36:50 +0300
committerHaruka Matsumoto <harukam0416@gmail.com>2018-01-24 06:35:16 +0300
commit1ff43e05e0495b1b82b1bec2aeed27f25dfb5f20 (patch)
tree52276a3e64703552bad027f100abd281a6d3e9b9 /Mono.Debugger.Soft
parent1202e7430825f35657421366e22cd2f4164a8601 (diff)
Support this/base reference and local variables
inside lambda on Immediate Pad. - Enable to use this/base reference and local variables only if its type is public
Diffstat (limited to 'Mono.Debugger.Soft')
-rw-r--r--Mono.Debugger.Soft/Mono.Debugger.Soft/DelayedLambdaType.cs20
-rw-r--r--Mono.Debugger.Soft/Mono.Debugger.Soft/DelayedLambdaValue.cs14
2 files changed, 31 insertions, 3 deletions
diff --git a/Mono.Debugger.Soft/Mono.Debugger.Soft/DelayedLambdaType.cs b/Mono.Debugger.Soft/Mono.Debugger.Soft/DelayedLambdaType.cs
index f071c91..77950d7 100644
--- a/Mono.Debugger.Soft/Mono.Debugger.Soft/DelayedLambdaType.cs
+++ b/Mono.Debugger.Soft/Mono.Debugger.Soft/DelayedLambdaType.cs
@@ -17,11 +17,13 @@ namespace Mono.Debugger.Soft
}
string expression;
+ Tuple<string, Value>[] locals;
string uniqueName;
- public DelayedLambdaType (VirtualMachine vm, string expression) : base (vm, 0)
+ public DelayedLambdaType (VirtualMachine vm, Tuple<string, Value>[] locals, string expression) : base (vm, 0)
{
this.expression = expression;
+ this.locals = locals;
this.uniqueName = "Lambda" + Guid.NewGuid ().ToString ("N");
}
@@ -29,10 +31,26 @@ namespace Mono.Debugger.Soft
get { return expression; }
}
+ public Tuple<string, Value>[] Locals {
+ get {
+ if (locals == null)
+ return new Tuple<string, Value> [0];
+ return locals;
+ }
+ }
+
public string Name {
get { return uniqueName; }
}
+ public Value[] GetLocalValues ()
+ {
+ var vals = new Value [Locals.Length];
+ for (int i = 0; i < vals.Length; i++)
+ vals [i] = Locals [i].Item2;
+ return vals;
+ }
+
public bool IsAcceptableType (TypeMirror t)
{
return IsAcceptable (ParseFullName (t));
diff --git a/Mono.Debugger.Soft/Mono.Debugger.Soft/DelayedLambdaValue.cs b/Mono.Debugger.Soft/Mono.Debugger.Soft/DelayedLambdaValue.cs
index 657a69a..6b2a729 100644
--- a/Mono.Debugger.Soft/Mono.Debugger.Soft/DelayedLambdaValue.cs
+++ b/Mono.Debugger.Soft/Mono.Debugger.Soft/DelayedLambdaValue.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
namespace Mono.Debugger.Soft
{
@@ -6,9 +7,9 @@ namespace Mono.Debugger.Soft
{
DelayedLambdaType delayedType;
- public DelayedLambdaValue (VirtualMachine vm, string expression) : base (vm, 0)
+ public DelayedLambdaValue (VirtualMachine vm, Tuple<string, Value>[] locals, string expression) : base (vm, 0)
{
- this.delayedType = new DelayedLambdaType (vm, expression);
+ this.delayedType = new DelayedLambdaType (vm, locals, expression);
}
public string Expression {
@@ -23,6 +24,15 @@ namespace Mono.Debugger.Soft
get { return DelayedType.Name; }
}
+ public Tuple<string, Value>[] Locals {
+ get { return DelayedType.Locals; }
+ }
+
+ public Value[] GetLocalValues ()
+ {
+ return DelayedType.GetLocalValues ();
+ }
+
public string GetLiteralType (TypeMirror t)
{
return delayedType.GetLiteralType (t);