Ejemplo n.º 1
0
        public SymbolFunctionInfo ProcessFunction(IDiaSymbol symbol)
        {
            if (symbol.compilerGenerated > 0)
            {
                return(null);
            }

            var info = new SymbolFunctionInfo();

            if (symbol.isStatic > 0)
            {
                info.Category = SymbolFunctionInfo.FunctionCategory.StaticFunction;
            }
            else if (symbol.classParent.name.EndsWith(symbol.name))
            {
                info.Category = SymbolFunctionInfo.FunctionCategory.Constructor;
            }
            else if (symbol.name.StartsWith("~"))
            {
                info.Category = SymbolFunctionInfo.FunctionCategory.Destructor;
            }
            else
            {
                info.Category = SymbolFunctionInfo.FunctionCategory.Function;
            }

            info.Virtual    = (symbol.@virtual == 1);
            info.IsOverride = info.Virtual && (symbol.intro == 0);
            info.IsPure     = info.Virtual && (symbol.pure != 0);
            info.IsConst    = symbol.constType != 0;
            if (symbol.wasInlined == 0 && symbol.inlSpec != 0)
            {
                info.WasInlineRemoved = true;
            }

            info.Name = GetType(symbol.type.type) + " " + symbol.name;

            symbol.type.findChildren(SymTagEnum.SymTagFunctionArgType, null, 0, out var syms);
            if (syms.count == 0)
            {
                info.Name += "(void)";
            }
            else
            {
                var parameters = new List <string>();
                foreach (IDiaSymbol argSym in syms)
                {
                    parameters.Add(GetType(argSym.type));
                }
                info.Name += "(" + string.Join(",", parameters) + ")";
            }
            return(info);
        }
Ejemplo n.º 2
0
        private void CheckMasking(SymbolFunctionInfo func)
        {
            foreach (var function in Functions)
            {
                if (function.Virtual == false && function.Name == func.Name)
                {
                    function.IsMasking = true;

                    if (DerivedClasses != null)
                    {
                        foreach (var derivedClass in DerivedClasses)
                        {
                            derivedClass.CheckMasking(func);
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 private bool IsOverloadingFunction(SymbolFunctionInfo func)
 {
     foreach (var function in Functions)
     {
         if (function.Name == func.Name)
         {
             return(true);
         }
     }
     if (DerivedClasses != null)
     {
         foreach (var derivedClass in DerivedClasses)
         {
             if (derivedClass.IsOverloadingFunction(func))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Ejemplo n.º 4
0
 private void AddFunction(SymbolFunctionInfo function)
 {
     Functions.Add(function);
 }