/// <inheritdoc/>
 public override ParameterInfo[] GetParameters()
 {
     if (parameters == null)
     {
         parameters = new ParameterInfo[this.MethodDefSig.ParamCount];
         for (int i = 0; i < parameters.Length; i++)
         {
             string name;
             try {
                 // index = 0 is return parameter
                 name = this.DebugModule.MetaData.GetParamPropsForMethodIndex((uint)this.MetadataToken, (uint)i + 1).Name;
             } catch {
                 name = String.Empty;
             }
             int iCopy = i;
             parameters[i] =
                 new DebugParameterInfo(
                     this,
                     name,
                     DebugType.CreateFromSignature(this.DebugModule, this.MethodDefSig.Parameters[i].Type, declaringType),
                     i,
                     delegate(StackFrame context) { return(context.GetArgumentValue(iCopy)); }
                     );
         }
     }
     return(parameters);
 }
        List <DebugLocalVariableInfo> GetLocalVariablesInScope(ISymUnmanagedScope symScope)
        {
            List <DebugLocalVariableInfo> vars = new List <DebugLocalVariableInfo>();

            foreach (ISymUnmanagedVariable symVar in symScope.GetLocals())
            {
                ISymUnmanagedVariable symVarCopy = symVar;
                int                       start;
                SignatureReader           sigReader  = new SignatureReader(symVar.GetSignature());
                LocalVarSig.LocalVariable locVarSig  = sigReader.ReadLocalVariable(sigReader.Blob, 0, out start);
                DebugType                 locVarType = DebugType.CreateFromSignature(this.DebugModule, locVarSig.Type, declaringType);
                // Compiler generated?
                // NB: Display class does not have the compiler-generated flag
                if ((symVar.GetAttributes() & 1) == 1 || symVar.GetName().StartsWith("CS$"))
                {
                    // Get display class from local variable
                    if (locVarType.IsDisplayClass)
                    {
                        AddCapturedLocalVariables(
                            vars,
                            (int)symScope.GetStartOffset(),
                            (int)symScope.GetEndOffset(),
                            delegate(StackFrame context) {
                            return(GetLocalVariableValue(context, symVarCopy));
                        },
                            locVarType
                            );
                    }
                }
                else
                {
                    DebugLocalVariableInfo locVar = new DebugLocalVariableInfo(
                        symVar.GetName(),
                        (int)symVar.GetAddressField1(),
                        // symVar also has Get*Offset methods, but the are not implemented
                        (int)symScope.GetStartOffset(),
                        (int)symScope.GetEndOffset(),
                        locVarType,
                        delegate(StackFrame context) {
                        return(GetLocalVariableValue(context, symVarCopy));
                    }
                        );
                    vars.Add(locVar);
                }
            }
            foreach (ISymUnmanagedScope childScope in symScope.GetChildren())
            {
                vars.AddRange(GetLocalVariablesInScope(childScope));
            }
            return(vars);
        }