示例#1
0
        public IEnumerable <Debugger.SequencePoint> GetSequencePoints(Module module, string filename, int line, int column)
        {
            var name = DecompiledTypeReference.FromFileName(filename);

            if (name == null || !FileUtility.IsEqualFileName(module.FullPath, name.AssemblyFile))
            {
                yield break;
            }

            var file = SD.ParserService.ParseFile(name.ToFileName()) as ILSpyUnresolvedFile;

            if (file == null)
            {
                yield break;
            }

            TextLocation loc = new TextLocation(line, column);

            foreach (var symbols in file.DebugSymbols.Values.Where(s => s.StartLocation <= loc && loc <= s.EndLocation))
            {
                Decompiler.SequencePoint seq = null;
                if (column != 0)
                {
                    seq = symbols.SequencePoints.FirstOrDefault(p => p.StartLocation <= loc && loc <= p.EndLocation);
                }
                if (seq == null)
                {
                    seq = symbols.SequencePoints.FirstOrDefault(p => line <= p.StartLocation.Line);
                }
                if (seq != null)
                {
                    yield return(seq.ToDebugger(symbols, filename));
                }
            }
        }
示例#2
0
        public ICompilation CreateCompilationForSingleFile(FileName fileName, IUnresolvedFile unresolvedFile)
        {
            DecompiledTypeReference reference = DecompiledTypeReference.FromFileName(fileName);

            if (reference != null)
            {
                var model = SD.GetService <IClassBrowser>().FindAssemblyModel(reference.AssemblyFile);
                if (model == null)
                {
                    model = SD.AssemblyParserService.GetAssemblyModelSafe(reference.AssemblyFile, true);
                }
                if (model != null)
                {
                    return(model.Context.GetCompilation());
                }
            }
            return(new CSharpProjectContent()
                   .AddOrUpdateFiles(unresolvedFile)
                   .CreateCompilation());
        }
示例#3
0
 public ParseInformation Parse(FileName fileName, ITextSource fileContent, bool fullParseInformationRequested, IProject parentProject, CancellationToken cancellationToken)
 {
     return(ILSpyDecompilerService.DecompileType(DecompiledTypeReference.FromFileName(fileName), cancellationToken));
 }
 public IViewContent CreateContentForFile(OpenedFile file)
 {
     return(new DecompiledViewContent(DecompiledTypeReference.FromFileName(file.FileName), ""));
 }