Exemplo n.º 1
0
        public override CodeLocation GetCodeLocation()
        {
            CodeLocation location = DebugSymbolUtils.GetSourceLocation(Target);

            if (location == CodeLocation.Unknown)
            {
                location = Assembly.GetCodeLocation();
            }
            return(location);
        }
Exemplo n.º 2
0
        private CodeLocation GetMethodSourceLocation(MethodDefinition methodDefinition)
        {
            if (symbolResolver == null)
            {
                symbolResolver = DebugSymbolUtils.CreateResolver();
            }

            var assemblyPath  = assemblyResolver.GetAssemblyPath(methodDefinition.DeclaringType.Module.Assembly);
            var metadataToken = (int)methodDefinition.MetadataToken.ToUInt32();

            return(symbolResolver.GetSourceLocationForMethod(assemblyPath, metadataToken));
        }