Beispiel #1
0
        public VSCodeScope(VSCodeStackFrame info, StackFrame frame, Scope.PresentationHintValue name, int varCnt, int varOffset, FileLinePositionSpan span)
        {
            this.info              = info;
            scope                  = new Scope();
            scope.Name             = name.ToString();
            scope.PresentationHint = name;
            scope.Source           = frame.Source;
            if (span.IsValid)
            {
                scope.Line      = span.StartLinePosition.Line + 1;
                scope.Column    = span.StartLinePosition.Character + 1;
                scope.EndLine   = span.EndLinePosition.Line + 1;
                scope.EndColumn = span.EndLinePosition.Character + 1;
            }
            else
            {
                scope.Line      = frame.Line;
                scope.Column    = frame.Column;
                scope.EndLine   = frame.EndLine;
                scope.EndColumn = frame.EndColumn;
            }
            scope.NamedVariables     = varCnt;
            scope.VariablesReference = GetHashCode();

            for (int i = 0; i < varCnt; i++)
            {
                var v        = info.Info.LocalVariables[varOffset + i];
                var variable = new VSCodeVariable(info, v);
                variables.Add(variable);
                if (v.Expandable)
                {
                    variableMapping[variable.GetHashCode()] = variable;
                }
            }
        }
Beispiel #2
0
        public VSCodeVariable[] EnumChildren(int dwTimeout)
        {
            var thread   = frame.Thread;
            var c        = thread.Engine.EnumChildren(GetVariableReference(), thread.ThreadID, frame.Index, (uint)Math.Max(dwTimeout, 5000));
            var children = new VSCodeVariable[c.Length];

            for (int i = 0; i < c.Length; i++)
            {
                var            vi = c[i];
                VSCodeVariable v  = new VSCodeVariable(frame, vi);
                if (vi.Type == VariableTypes.IndexAccess)
                {
                    v.Parameters = new VariableReference[] { VariableReference.GetInteger(vi.Offset) }
                }
                ;
                v.Parent = this;
                frame.RegisterVariable(v);
                children[i] = v;
            }

            return(children);
        }
Beispiel #3
0
 public void RegisterVariable(VSCodeVariable variable)
 {
     variableMapping[variable.GetHashCode()] = variable;
 }