Esempio n. 1
0
        /// <summary>
        /// Creates an UndoableChange for an address map update.
        /// </summary>
        /// <param name="offset">Affected offset.</param>
        /// <param name="oldEntry">Previous address map entry, or null if none.</param>
        /// <param name="newEntry">New address map entry, or null for deletion.</param>
        /// <returns>Change record.</returns>
        public static UndoableChange CreateAddressChange(AddressMap.AddressMapEntry oldEntry,
                                                         AddressMap.AddressMapEntry newEntry)
        {
            int offset;

            if (oldEntry != null)
            {
                offset = oldEntry.Offset;
            }
            else if (newEntry != null)
            {
                offset = newEntry.Offset;
            }
            else
            {
                // Shouldn't happen.
                Debug.Assert(false);
                offset = -1;
            }
            if (oldEntry == newEntry)
            {
                Debug.WriteLine("No-op address change at +" + offset.ToString("x6"));
            }
            UndoableChange uc = new UndoableChange();

            uc.Type               = ChangeType.SetAddress;
            uc.Offset             = offset;
            uc.OldValue           = oldEntry;
            uc.NewValue           = newEntry;
            uc.ReanalysisRequired = ReanalysisScope.CodeAndData;
            return(uc);
        }
Esempio n. 2
0
 public SerAddressMap(AddressMap.AddressMapEntry ent)
 {
     Offset = ent.Offset;
     Addr   = ent.Addr;
 }