コード例 #1
0
        private void ReadLines(SymbolCollectionSegment aSegment)
        {
            long count = 0;

            // Make a new collection to which we'll add symbols
            SymbolCollection collection = aSegment.Collection;

            collection.TransactionBegin();

            // We'll use this to filter out bad symbols
            try
            {
                using (SymbolCollectionHarmoniser harmoniser = new SymbolCollectionHarmoniser(collection, SymbolCollectionHarmoniser.TCollectionType.EPossiblyXIP))
                {
                    // Then create symbols
                    SymbolCreator creator = new SymbolCreator();
                    foreach (string line in aSegment)
                    {
                        Symbol symbol = creator.Parse(line, collection);
                        if (symbol != null)
                        {
                            harmoniser.Add(symbol);
                        }
                        //
                        ++count;
                    }
                }
            }
            finally
            {
                collection.TransactionEnd();

                // Collection is now complete - run final validation in
                // background thread
                ValidateAndSaveCollection(collection);
            }

            ReportProgress(count);

#if INSPECT_SYMBOL_DATA
            using (StreamWriter writer = new StreamWriter(@"C:\Temp\NewSymbols\" + Path.GetFileName(collection.FileName.FileNameInHost) + ".symbol"))
            {
                WriteToStream(collection, writer);
            }
#endif
        }
コード例 #2
0
ファイル: MapReader.cs プロジェクト: fedor4ever/CrashAnalyser
 protected MapReader(SymSource aSource, ITracer aTracer)
     : base(aSource.FileName, aTracer)
 {
     iSource     = aSource;
     iHarmoniser = new SymbolCollectionHarmoniser(Collection);
 }