예제 #1
0
        /// <inheritdoc />
        public void AssignAlias(Snapshot snapshot, Memory.MemoryPath targetPath, Memory.MemoryPath sourcePath)
        {
            //Collect alias indexes
            AssignCollector sourceCollector = new AssignCollector(snapshot);

            sourceCollector.ProcessPath(sourcePath);

            //Memory locations where to get data from
            ReadCollector valueCollector = new ReadCollector(snapshot);

            valueCollector.ProcessPath(sourcePath);

            //Get data from locations
            ReadWorker  worker = new ReadWorker(snapshot);
            MemoryEntry value  = worker.ReadValue(valueCollector);

            //Makes deep copy of data to prevent changes after assign alias
            TemporaryIndex            temporaryIndex = snapshot.CreateTemporary();
            MergeWithinSnapshotWorker mergeWorker    = new MergeWithinSnapshotWorker(snapshot);

            mergeWorker.MergeMemoryEntry(temporaryIndex, value);

            //Memory locations to store data into
            AssignCollector targetCollector = new AssignCollector(snapshot);

            targetCollector.AliasesProcessing = AliasesProcessing.BeforeCollecting;
            targetCollector.ProcessPath(targetPath);

            AssignAliasWorker assignWorker = new AssignAliasWorker(snapshot);

            assignWorker.AssignAlias(sourceCollector, targetCollector, temporaryIndex);

            snapshot.ReleaseTemporary(temporaryIndex);
        }
예제 #2
0
        /// <inheritdoc />
        public void Assign(Snapshot snapshot, Memory.MemoryPath path, AnalysisFramework.Memory.MemoryEntry value, bool forceStrongWrite)
        {
            TemporaryIndex            temporaryIndex = snapshot.CreateTemporary();
            MergeWithinSnapshotWorker mergeWorker    = new MergeWithinSnapshotWorker(snapshot);

            mergeWorker.MergeMemoryEntry(temporaryIndex, value);

            AssignCollector collector = new AssignCollector(snapshot);

            collector.ProcessPath(path);

            if (forceStrongWrite)
            {
                collector.SetAllToMust();
            }

            AssignWorker worker = new AssignWorker(snapshot);

            worker.Assign(collector, temporaryIndex);

            snapshot.ReleaseTemporary(temporaryIndex);
        }
예제 #3
0
        /// <inheritdoc />
        public void MergeMemoryEntry(Snapshot snapshot, TemporaryIndex temporaryIndex, MemoryEntry dataEntry)
        {
            MergeWithinSnapshotWorker mergeWorker = new MergeWithinSnapshotWorker(snapshot);

            mergeWorker.MergeMemoryEntry(temporaryIndex, dataEntry);
        }