Revert "[sdb] Add an API to make the contents of the 'State Machine Hoisted Local...
[mono.git] / mcs / class / Mono.Debugger.Soft / Mono.Debugger.Soft / MethodMirror.cs
index 88dd7277c20262752cb2ecaf7a21f8e5e48432cf..fb10f7117c30258350bad2e93053dac7cbb14cbe 100644 (file)
@@ -19,6 +19,7 @@ namespace Mono.Debugger.Soft
                ParameterInfoMirror[] param_info;
                ParameterInfoMirror ret_param;
                LocalVariable[] locals;
+               LocalScope[] scopes;
                IList<Location> locations;
                MethodBodyMirror body;
                MethodMirror gmd;
@@ -239,6 +240,12 @@ namespace Mono.Debugger.Soft
                        }
                }
 
+               public LocalScope [] GetScopes () {
+                       vm.CheckProtocolVersion (2, 43);
+                       GetLocals ();
+                       return scopes;
+               }
+
                public LocalVariable[] GetLocals () {
                        if (locals == null) {
                                LocalsInfo li = new LocalsInfo ();
@@ -258,6 +265,12 @@ namespace Mono.Debugger.Soft
 
                                for (int i = 0; i < li.names.Length; ++i)
                                        locals [i + pi.Length] = new LocalVariable (vm, this, i, li.types [i], li.names [i], li.live_range_start [i], li.live_range_end [i], false);
+
+                               if (vm.Version.AtLeast (2, 43)) {
+                                       scopes = new LocalScope [li.scopes_start.Length];
+                                       for (int i = 0; i < scopes.Length; ++i)
+                                               scopes [i] = new LocalScope (vm, this, li.scopes_start [i], li.scopes_end [i]);
+                               }
                        }
                        return locals;
                }