Пример #1
0
        public CodeSegDefinition Resolve(CodeSegDefinition aDefinition, bool aMapFileMustExistsWhenCreatingEntry)
        {
            CodeSegDefinition ret = aDefinition;

            // ... and now try to resolve real file name on the PC side
            string realPCMapFileName = ResolveByImageCodeSegmentFileName(ret.ImageFileNameAndPath);

            if (realPCMapFileName != string.Empty)
            {
                ret.EnvironmentFileNameAndPath = realPCMapFileName;
            }
            else if (aMapFileMustExistsWhenCreatingEntry == false)
            {
                MemoryModel.TMemoryModelType   memModelType   = MemoryModel.TypeByAddress(ret.AddressStart);
                MemoryModel.TMemoryModelRegion memModelRegion = MemoryModel.RegionByAddress(ret.AddressStart, memModelType);

                // Don't cache ROM code segments
                switch (memModelRegion)
                {
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionRAMLoadedCode:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionUserGlobalArea:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionDLLStaticData:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionKernelGlobalsInitialStackKernelHeap:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionKernelCode:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionMovingProcessData:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionFixedProcesses:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionUserCode:
                    System.Diagnostics.Debug.WriteLine("[WARNING] Map file for: " + ret.ImageFileNameAndPath + " was not found => creating empty MapFile for this RAM-loaded code seg.");
                    ret.EnvironmentFileNameAndPath = CreateDefaultReleaseFileName(ret.ImageFileName);
                    break;

                // Common
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionUnmapped:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionRAMDrive:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionSuperAndCPUPages:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionPageTableInfo:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionPageDirectories:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionPageTables:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionPrimaryIOMappings:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionUnknown:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionExtraKernelMappings:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionExceptionVectors:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionROM:

                // Moving
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionCacheFlushArea:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionCacheFlushAreaAlternate:

                // Multiple
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionSharedData:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionLocalData:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionASIDInfo:
                case MemoryModel.TMemoryModelRegion.EMemoryModelRegionKernelStacks:
                    ret = null;
                    break;
                }
            }
            else
            {
                ret = null;
            }

            return(ret);
        }
Пример #2
0
 public CodeSegDefinition Resolve(CodeSegDefinition aDefinition)
 {
     return(Resolve(aDefinition, false));
 }