コード例 #1
0
        public override DbgEntity Create(FSEntity aEntity)
        {
            // Returns null if not supported
            DbgEntity ret = UnsupportedEntity.New(this, aEntity);

            return(ret);
        }
コード例 #2
0
ファイル: TestCode.cs プロジェクト: fedor4ever/CrashAnalyser
        private void DebugEngine_EntityPrimingComplete(DbgEngine aEngine, DbgEntity aEntity, object aContext)
        {
            DateTime time = DateTime.Now;
            TimeSpan ts   = time - iTimePrimingStarted;
            int      ms   = (int)ts.TotalMilliseconds;

            Trace("[Priming] Complete: {0:d12}, file: {1}", ms, aEntity.FullName);
        }
コード例 #3
0
        private void DbgEngine_EntityPrimingStarted(DbgEngine aEngine, DbgEntity aEntity, object aContext)
        {
            Trace("[CA Cmd] Priming debug meta-data: " + aEntity.FullName);

            // Emit progress banner
            if (iReportProgress)
            {
                Print("Reading debug meta-data...");
            }
        }
コード例 #4
0
 private void DbgEngine_EntityPrimingProgress(DbgEngine aEngine, DbgEntity aEntity, object aContext)
 {
     if (aContext != null)
     {
         if (aContext.GetType() == typeof(int))
         {
             int value = (int)aContext;
             Trace("[HA Cmd] Priming debug meta-data progress: {0:d3}% {1}", value, aEntity.FullName);
         }
     }
 }
コード例 #5
0
        protected override void OnFileLocated(FileInfo aFile)
        {
            base.OnFileLocated(aFile);
            //
            DbgEntity entity = iEngine.Add(aFile);

            if (entity != null)
            {
                // Files found this way are not explict
                entity.WasAddedExplicitly = false;
            }
        }
コード例 #6
0
        public DbgEntityPrimerSilent(DbgEntity aEntity, DbgPluginEngine aPlugin)
        {
            iEntity = aEntity;
            iPlugin = aPlugin;

            // Make a new primer and seed it with the entity.
            iPrimer = aPlugin.CreatePrimer();
            iPrimer.Add(aEntity);

            // Listen to plugin primer events
            iPrimer.EventHandler += new DbgPluginPrimer.PrimeEventHandler(PrimerPlugin_EventHandler);
        }
コード例 #7
0
        private void PrimeDebugEngine()
        {
            DbgEngine debugEngine = base.Engine.DebugEngine;
            //
            Exception primerException = null;
            HACmdLineFSEntityList <HACmdLineFSEntity> metaDataFiles = iInputs.MetaDataFiles;

            //
            try
            {
                debugEngine.Clear();

                foreach (HACmdLineFSEntity entry in metaDataFiles)
                {
                    Trace("[HA Cmd] Seeding debug meta engine with entry: " + entry.Name);
                    DbgEntity entity = debugEngine.Add(entry.Name);
                    if (entity != null)
                    {
                        Trace("[HA Cmd] Entry type detected as: [" + entity.CategoryName + "]");
                        entity.Tag = entry;
                    }
                    else
                    {
                        Trace("[HA Cmd] Entry not handled: " + entry.Name);
                    }
                }

                // Listen to prime events
                try
                {
                    Trace("[HA Cmd] Starting prime operation... ");
                    debugEngine.EntityPrimingStarted  += new DbgEngine.EventHandler(DbgEngine_EntityPrimingStarted);
                    debugEngine.EntityPrimingProgress += new DbgEngine.EventHandler(DbgEngine_EntityPrimingProgress);
                    debugEngine.EntityPrimingComplete += new DbgEngine.EventHandler(DbgEngine_EntityPrimingComplete);
                    debugEngine.Prime(TSynchronicity.EAsynchronous);
                    Trace("[HA Cmd] Debug meta data priming completed successfully.");
                }
                finally
                {
                    debugEngine.EntityPrimingStarted  -= new DbgEngine.EventHandler(DbgEngine_EntityPrimingStarted);
                    debugEngine.EntityPrimingProgress -= new DbgEngine.EventHandler(DbgEngine_EntityPrimingProgress);
                    debugEngine.EntityPrimingComplete -= new DbgEngine.EventHandler(DbgEngine_EntityPrimingComplete);
                }
            }
            catch (Exception exception)
            {
                Trace("[HA Cmd] Debug meta data priming exception: " + exception.Message + ", " + exception.StackTrace);
                primerException = exception;
            }
        }
コード例 #8
0
ファイル: TestCode.cs プロジェクト: fedor4ever/CrashAnalyser
 private void DebugEngine_EntityPrimingProgress(DbgEngine aEngine, DbgEntity aEntity, object aContext)
 {
     if (aContext != null && aContext is int)
     {
         int prog = (int)aContext;
         if ((prog % 10) == 0)
         {
             DateTime time = DateTime.Now;
             TimeSpan ts   = time - iTimePrimingStarted;
             int      ms   = (int)ts.TotalMilliseconds;
             Trace("[Priming] Progress: {0:d12}, file: {1}", ms, aEntity.FullName);
         }
     }
 }
コード例 #9
0
ファイル: Form1.cs プロジェクト: fedor4ever/CrashAnalyser
 private void DebugEngine_EntityPrimingProgress(DbgEngine aEngine, DbgEntity aEntity, object aContext)
 {
     if (this.InvokeRequired)
     {
         DbgEngine.EventHandler observer = new DbgEngine.EventHandler(DebugEngine_EntityPrimingProgress);
         this.BeginInvoke(observer, new object[] { aEngine, aEntity, aContext });
     }
     else
     {
         if (aContext != null && aContext is int)
         {
             progressBar1.Value = (int)aContext;
         }
     }
 }
コード例 #10
0
ファイル: Form1.cs プロジェクト: fedor4ever/CrashAnalyser
 private void DebugEngine_EntityPrimingStarted(DbgEngine aEngine, DbgEntity aEntity, object aContext)
 {
     if (this.InvokeRequired)
     {
         DbgEngine.EventHandler observer = new DbgEngine.EventHandler(DebugEngine_EntityPrimingStarted);
         this.BeginInvoke(observer, new object[] { aEngine, aEntity, aContext });
     }
     else
     {
         label1.Text          = "Reading...";
         progressBar1.Minimum = 0;
         progressBar1.Maximum = 100;
         progressBar1.Value   = 0;
     }
 }
コード例 #11
0
        public DbgEntityPrimerUi(DbgEntity aEntity, DbgPluginEngine aPlugin)
        {
            iEntity = aEntity;
            iPlugin = aPlugin;

            // Make a new primer and seed it with the entity.
            iPrimer = aPlugin.CreatePrimer();
            iPrimer.Add(aEntity);

            // Listen to plugin primer events
            iPrimer.EventHandler += new DbgPluginPrimer.PrimeEventHandler(PrimerPlugin_EventHandler);
            //
            this.InitializeComponent();
            this.Text = string.Format("Preparing: [{0}]", Path.GetFileName(aEntity.FullName));
        }
コード例 #12
0
        private void DbgEngine_EntityPrimingProgress(DbgEngine aEngine, DbgEntity aEntity, object aContext)
        {
            if (aContext != null)
            {
                if (aContext.GetType() == typeof(int))
                {
                    int value = (int)aContext;
                    UITrace("[CA Cmd] Priming debug meta-data progress: {0:d3}% {1}", value, aEntity.FullName);

                    // If reporting progress, then output something so the carbide extension is aware
                    // of what is going on in the background.
                    iProgressReporter.StepProgress(string.Empty, value, aEntity.FullName);
                }
            }
        }
コード例 #13
0
        public override void Add(DbgEntity aEntity)
        {
            SymSourceProvider provider = null;

            //
            if (aEntity.FSEntity.IsFile)
            {
                if (aEntity.Exists && aEntity.FSEntity.IsValid)
                {
                    provider = ProvisioningManager.GetProvider(aEntity.FSEntity.FullName);
                }
                //
                if (provider != null)
                {
                    using (SymSourceCollection sources = provider.CreateSources(aEntity.FullName))
                    {
                        // Make sure the time to read attribute is setup in alignment with
                        // whether the entity was explicitly added by the user or found implicitly
                        // by scanning.
                        if (aEntity.WasAddedExplicitly == false)
                        {
                            foreach (SymSource source in sources)
                            {
                                // This means, don't read this source until it is actually
                                // referenced by the client. I.e. until the client activates
                                // a code segment that refers to this
                                source.TimeToRead = SymSource.TTimeToRead.EReadWhenNeeded;
                            }
                        }

                        // Ownership is transferred
                        iSources.AddRange(sources);
                        sources.Clear();
                    }
                }
                else
                {
                    throw new NotSupportedException("Specified file type is not supported");
                }
            }
            else
            {
                throw new ArgumentException("SymbianSymbolLib does not support directory entities");
            }
        }
コード例 #14
0
        private void DbgEngine_EntityPrimingProgress(DbgEngine aEngine, DbgEntity aEntity, object aContext)
        {
            if (aContext != null)
            {
                if (aContext.GetType() == typeof(int))
                {
                    int value = (int)aContext;
                    Trace("[CA Cmd] Priming debug meta-data progress: {0:d3}% {1}", value, aEntity.FullName);

                    // If reporting progress, then output something so the carbide extension is aware
                    // of what is going on in the background.
                    if (iReportProgress)
                    {
                        string msg = string.Format("{1:d3}%, {0}", aEntity.FullName, value);
                        Print(msg);
                    }
                }
            }
        }
コード例 #15
0
ファイル: Form1.cs プロジェクト: fedor4ever/CrashAnalyser
        private void DebugEngine_EntityPrimingComplete(DbgEngine aEngine, DbgEntity aEntity, object aContext)
        {
            if (this.InvokeRequired)
            {
                DbgEngine.EventHandler observer = new DbgEngine.EventHandler(DebugEngine_EntityPrimingComplete);
                this.BeginInvoke(observer, new object[] { aEngine, aEntity, aContext });
            }
            else
            {
                DateTime endTime = DateTime.Now;
                TimeSpan span    = endTime - iStartTime;
                label1.Text        = "Done - " + span.ToString();
                progressBar1.Value = progressBar1.Maximum;

                if (AreAllEntitiesPrimed)
                {
                    RunTests();
                }
            }
        }
コード例 #16
0
        internal void Prime(DbgEntity aEntity, TSynchronicity aSynchronicity)
        {
            // Make a new result
            aEntity.PrimerResult = new DbgEntityPrimerResult(aEntity);

            // The primer to use
            IDbgEntityPrimer primer = null;

            // We can't sensibly prime if we don't have a plugin engine associated with the
            // entity.
            DbgPluginEngine plugin = aEntity.PluginEngine;

            if (plugin != null)
            {
                // Get primer object
                switch (UiMode)
                {
                case TDbgUiMode.EUiDisabled:
                    primer = new DbgEntityPrimerSilent(aEntity, plugin);
                    break;

                default:
                case TDbgUiMode.EUiEnabled:
                    primer = new DbgEntityPrimerUi(aEntity, plugin);
                    break;
                }
            }
            else
            {
                primer = new DbgEntityPrimerNull(aEntity);
                Engine.Trace("WARNING: Entity {0} does not supply plugin engine", aEntity.FullName);
            }

            // Make sure we indicate that we actually atttempted to prime
            // the entity.
            aEntity.PrimerResult.PrimeAttempted = true;

            // And prime away
            primer.Prime(aSynchronicity);
        }
コード例 #17
0
        internal DbgEntity Create(XmlSettingCategory aSettingsCategory)
        {
            DbgEntity ret = null;

            //
            foreach (DbgEntityDescriptor descriptor in iDescriptors)
            {
                try
                {
                    ret = descriptor.Create(aSettingsCategory);
                    if (ret != null)
                    {
                        break;
                    }
                }
                catch (Exception)
                {
                }
            }
            //
            return(ret);
        }
コード例 #18
0
        private DbgEntity FindDescriptorAndCreateEntry(FSEntity aFSEntity)
        {
            DbgEntity ret = null;

            //
            foreach (DbgEntityDescriptor descriptor in iDescriptors)
            {
                try
                {
                    ret = descriptor.Create(aFSEntity);
                    if (ret != null)
                    {
                        break;
                    }
                }
                catch (Exception)
                {
                }
            }
            //
            return(ret);
        }
コード例 #19
0
 private void DbgEngine_EntityPrimingComplete(DbgEngine aEngine, DbgEntity aEntity, object aContext)
 {
     Trace("[HA Cmd] Primed debug meta-data: " + aEntity.FullName);
 }
コード例 #20
0
        internal DbgEntity Create(FSEntity aFSEntity)
        {
            DbgEntity ret = FindDescriptorAndCreateEntry(aFSEntity);

            return(ret);
        }
コード例 #21
0
        public override DbgEntity Create(XmlSettingCategory aSettingsCategory)
        {
            DbgEntity ret = UnsupportedEntity.New(this, aSettingsCategory);

            return(ret);
        }
コード例 #22
0
 private void DbgEngine_EntityPrimingComplete(DbgEngine aEngine, DbgEntity aEntity, object aContext)
 {
     iProgressReporter.StepEnd(string.Empty, aEntity.FullName);
     UITrace("[CA Cmd] Primed debug meta-data: " + aEntity.FullName);
 }
コード例 #23
0
 internal DbgEntityPrimerResult(DbgEntity aEntity)
 {
     iEntity = aEntity;
 }
コード例 #24
0
 public abstract void Add(DbgEntity aEntity);
コード例 #25
0
 public DbgEntityPrimerNull(DbgEntity aEntity)
 {
     iEntity = aEntity;
 }
コード例 #26
0
        private void TryToPrimeDbgEngine()
        {
            DbgEngine debugEngine = iDebugEngine;
            //
            Exception primerException = null;
            CACmdLineFSEntityList <CACmdLineFSEntity> metaDataFiles = iInputs.MetaDataFiles;

            //
            try
            {
                debugEngine.Clear();

                foreach (CACmdLineFileSource file in iInputs.SourceFiles)
                {
                    // Tell all used RomIds to debugEngine.
                    if (file.RomId != null)
                    {
                        debugEngine.AddActiveRomId(file.RomId.Value);
                    }

                    // Tell all RomIds which needs symbols to debugEngine so that
                    // we load only symbols for those.
                    if (file.ContentType == TMobileCrashContentType.EContentTypePanic ||
                        file.ContentType == TMobileCrashContentType.EContentTypeException)
                    {
                        debugEngine.AddSymbolRomId(file.RomId.Value);
                    }
                }

                foreach (CACmdLineFSEntity entry in metaDataFiles)
                {
                    Trace("[CA Cmd] Seeding debug meta engine with entry: " + entry.Name);
                    DbgEntity entity = debugEngine.Add(entry.Name);
                    if (entity != null)
                    {
                        Trace("[CA Cmd] Entry type detected as: [" + entity.CategoryName + "]");
                        entity.Tag = entry;
                    }
                    else
                    {
                        Trace("[CA Cmd] Entry not handled: " + entry.Name);
                        entry.AddError("Meta-Data File Not Supported", "The file \'" + entry.Name + "\' is of unknown origin.");
                    }
                }

                // Listen to prime events
                try
                {
                    Trace("[CA Cmd] Starting prime operation... ");
                    debugEngine.EntityPrimingStarted  += new DbgEngine.EventHandler(DbgEngine_EntityPrimingStarted);
                    debugEngine.EntityPrimingProgress += new DbgEngine.EventHandler(DbgEngine_EntityPrimingProgress);
                    debugEngine.EntityPrimingComplete += new DbgEngine.EventHandler(DbgEngine_EntityPrimingComplete);
                    debugEngine.Prime(TSynchronicity.ESynchronous);
                    Trace("[CA Cmd] Debug meta data priming completed successfully.");
                }
                finally
                {
                    debugEngine.EntityPrimingStarted  -= new DbgEngine.EventHandler(DbgEngine_EntityPrimingStarted);
                    debugEngine.EntityPrimingProgress -= new DbgEngine.EventHandler(DbgEngine_EntityPrimingProgress);
                    debugEngine.EntityPrimingComplete -= new DbgEngine.EventHandler(DbgEngine_EntityPrimingComplete);
                }
            }
            catch (Exception exception)
            {
                Trace("[CA Cmd] Debug meta data priming exception: " + exception.Message + ", " + exception.StackTrace);
                primerException = exception;
            }

            // Go through each debug entity and check it for errors. Add diagnostics
            // and error messages where appropriate.
            foreach (DbgEntity entity in debugEngine)
            {
                string name = entity.FullName;
                //
                CACmdLineFSEntity file = metaDataFiles[name];
                file.Clear();
                //
                if (entity.PrimerResult.PrimedOkay)
                {
                    if (!entity.Exists)
                    {
                        file.AddError("Meta-Data File Missing", string.Format("The file \'{0}\' could not be found.", file.Name));
                    }
                    else if (entity.IsUnsupported)
                    {
                        file.AddError("Meta-Data File Not Supported", string.Format("The file \'{0}\' is of unknown origin.", file.Name));
                    }
                }
                else
                {
                    // Add error
                    file.AddError("Meta-Data Read Error", entity.PrimerResult.PrimeErrorMessage);

                    // And diagnostic information
                    Exception exception = entity.PrimerResult.PrimeException != null ? entity.PrimerResult.PrimeException : primerException;
                    if (exception != null)
                    {
                        file.AddDiagnostic("Meta-Data Exception Message", entity.PrimerResult.PrimeException.Message);
                        file.AddDiagnostic("Meta-Data Exception Stack", entity.PrimerResult.PrimeException.StackTrace);
                    }
                    else
                    {
                        file.AddDiagnostic("Meta-Data Unknown Failure", "No exception occurred at the primer or entity level?");
                    }
                }
            }
        }
コード例 #27
0
        private void DbgEngine_EntityPrimingStarted(DbgEngine aEngine, DbgEntity aEntity, object aContext)
        {
            UITrace("[CA Cmd] Priming debug meta-data: " + aEntity.FullName);

            iProgressReporter.StepBegin("Priming debug meta-data: " + aEntity.FullName, aEntity.FullName, 100);
        }
コード例 #28
0
ファイル: TestCode.cs プロジェクト: fedor4ever/CrashAnalyser
 private void DebugEngine_EntityPrimingStarted(DbgEngine aEngine, DbgEntity aEntity, object aContext)
 {
     iTimePrimingStarted = DateTime.Now;
     Trace("[Priming] Started : {0}, file: {1}", iTimePrimingStarted.ToString(), aEntity.FullName);
 }