Beispiel #1
0
        public ImgSource(string aURI, CodeSourceProvider aProvider, CodeCollection aCollection, SIContent aImageContent)
            : base(aURI, aProvider)
        {
            iImageContent = aImageContent;

            // Make sure we receive any requests from the collection object for code.
            aCollection.IfaceInstructionConverter = this;
            aCollection.IsRelocatable             = aImageContent.IsRelocationSupported;

            // XIP content should be read during priming.
            TTimeToRead timeToRead = TTimeToRead.EReadWhenPriming;

            if (aImageContent.IsRelocationSupported)
            {
                timeToRead = TTimeToRead.EReadWhenNeeded;
            }
            else
            {
                // If the image is fixed, then so is the collection base address
                aCollection.Relocate(aImageContent.RelocationAddress);
            }

            // Must add the collection *after* setting it's properties
            base.TimeToRead = timeToRead;
            base.Add(aCollection);
        }
Beispiel #2
0
        public override bool IsSupported(string aFileName, out string aType)
        {
            CodeSourceProvider provider = iProvisioningManager.GetProvider(aFileName);

            //
            if (provider != null)
            {
                aType = provider.Name;
            }
            else
            {
                aType = string.Empty;
            }
            //
            return(provider != null);
        }
Beispiel #3
0
        public override void Add(DbgEntity aEntity)
        {
            CodeSourceProvider provider = null;

            //
            if (aEntity.FSEntity.IsFile)
            {
                if (aEntity.Exists && aEntity.FSEntity.IsValid)
                {
                    provider = ProvisioningManager.GetProvider(aEntity.FSEntity.FullName);
                }
                //
                if (provider != null)
                {
                    using (CodeSourceCollection 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 (CodeSource 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 = CodeSource.TTimeToRead.EReadWhenNeeded;
                            }
                        }

                        // Ownership is transferred
                        iSources.AddRange(sources);
                        sources.Clear();
                    }
                }
                else
                {
                    throw new NotSupportedException("Specified file type is not supported");
                }
            }
            else
            {
                throw new ArgumentException("SymbianCodeLib does not support directory entities");
            }
        }
Beispiel #4
0
 public CodeSource(string aURI, CodeSourceProvider aProvider)
 {
     iURI      = aURI;
     iProvider = aProvider;
 }