Пример #1
0
 public void TakeSnapshot(StateSnapshot ss)
 {
     ss.WriteInt(names.Count);
     for(int i = 0; i < names.Count; i++)
     {
         ss.WriteString(names[i]);
         ss.WriteGuid(values[i]);
     }
 }
Пример #2
0
 public void TakeSnapshot(StateSnapshot ss)
 {
     ss.WriteInt(theMethod.ID);
     ss.WriteInt(theMethod.GetInstructionIndex(thePC));
 }
Пример #3
0
        public void TakeSnapshot(StateSnapshot ss)
        {
            ss.WriteGuid(threadID);

            ss.WriteInt((int)syncState);
            ss.WriteGuid(waitingOn);

            ss.WriteInt(threadStack.Count);
            for(int i = 0; i < threadStack.Count; i++)
                ss.WriteGuid(threadStack[i]);

            ss.WriteInt(localVariableBlocks.Count);
            for(int i = 0; i < localVariableBlocks.Count; i++)
            {
                localVariableBlocks[i].TakeSnapshot(ss);
            }

            ss.WriteInt(returnAddresses.Count);
            for(int i = 0; i < returnAddresses.Count; i++)
            {
                ReturnAddress ra = returnAddresses[i];
                ra.TakeSnapshot(ss);
            }

            ss.WriteInt(currentMethod.ID);
            ss.WriteInt(currentMethod.GetInstructionIndex(pc));

            ss.WriteInt(pendingActions.Count);
            for(int i = 0; i < pendingActions.Count; i++)
            {
                DelayedAction da = (DelayedAction)pendingActions[i];
                da.TakeSnapshot(ss);
            }
        }
Пример #4
0
 /// <summary>
 /// Called during TakeSnapshot in State to dump the data of this value
 /// </summary>
 /// <param name="ss"></param>
 public virtual void SaveData(StateSnapshot ss)
 {
     ss.WriteInt(isConcrete);
 }
Пример #5
0
 /// <summary>
 /// Called during TakeSnapshot in State so that all guids
 /// are reached and renamed
 /// This function is to be overriden by subclasses to traverse
 /// to guids linked to them
 /// </summary>
 public virtual void TraverseGuids(StateSnapshot ss)
 {
     // do nothing
 }
Пример #6
0
 /// <summary>
 /// Called during TakeSnapshot in State so that all guids
 /// are reached and renamed
 /// This function is to be overriden by subclasses to traverse
 /// to guids linked to them
 /// </summary>
 public override void TraverseGuids(StateSnapshot ss)
 {
     ss.Convert(threadStartGUID);
 }
Пример #7
0
 public override void TraverseGuids(StateSnapshot ss)
 {
     for(int i = 0; i < data.Length; i++)
         ss.Convert(data[i]);
 }
Пример #8
0
 /// <summary>
 /// Called during TakeSnapshot in State to dump the data of this value
 /// </summary>
 /// <param name="ss"></param>
 public override void SaveData(StateSnapshot ss)
 {
     base.SaveData(ss);
     ss.WriteLong(value);
 }
Пример #9
0
 public override void SaveData(StateSnapshot ss)
 {
     base.SaveData(ss);
     ss.WriteGuid(objGuid);
     ss.WriteGuid(ftnGuid);
 }
Пример #10
0
 /// <summary>
 /// Called during TakeSnapshot in State so that all guids
 /// are reached and renamed
 /// This function is to be overriden by subclasses to traverse
 /// to guids linked to them
 /// </summary>
 public override void TraverseGuids(StateSnapshot ss)
 {
     ss.Convert(objGuid);
     ss.Convert(ftnGuid);
 }
Пример #11
0
 /// <summary>
 /// Called during TakeSnapshot in State so that all guids
 /// are reached and renamed
 /// This function is to be overriden by subclasses to traverse
 /// to guids linked to them
 /// </summary>
 public override void TraverseGuids(StateSnapshot ss)
 {
     for(int i = 0; i < fields.Count; i++)
         ss.Convert(fields[i]);
 }
Пример #12
0
 public override void SaveData(StateSnapshot ss)
 {
     base.SaveData(ss);
     ss.WriteInt(classType.ID);
     ss.WriteGuid(holdingLockThreadID);
     ss.WriteInt(holdingLockCount);
     for(int i = 0; i < fields.Count; i++)
         ss.WriteGuid(fields[i]);
 }
Пример #13
0
 /// <summary>
 /// Called during TakeSnapshot in State to dump the data of this value
 /// </summary>
 /// <param name="ss"></param>
 public override void SaveData(StateSnapshot ss)
 {
     base.SaveData(ss);
     ss.WriteInt(method.ID);
 }
Пример #14
0
 public override void SaveData(StateSnapshot ss)
 {
     base.SaveData (ss);
     ss.WriteGuid(arrayInstGuid);
 }
Пример #15
0
        public void TakeSnapshot(StateSnapshot ss)
        {
            ss.WriteInt(variables.Count);
            for(int i = 0; i < variables.Count; i++)
                ss.WriteGuid(variables[i]);

            ss.WriteInt(arguments.Count);
            for(int i = 0; i < arguments.Count; i++)
                ss.WriteGuid(arguments[i]);
        }
Пример #16
0
 public override void TraverseGuids(StateSnapshot ss)
 {
     ss.Convert(arrayInstGuid);
 }
Пример #17
0
 /// <summary>
 /// Called during TakeSnapshot in State so that all guids
 /// are reached and renamed
 /// This function is to be overriden by subclasses to traverse
 /// to guids linked to them
 /// </summary>
 public override void TraverseGuids(StateSnapshot ss)
 {
     ss.Convert(valueguid);
 }
Пример #18
0
 public override void SaveData(StateSnapshot ss)
 {
     base.SaveData (ss);
     ss.WriteInt(data.Length);
     for(int i = 0; i < data.Length; i++)
         ss.WriteGuid(data[i]);
 }
Пример #19
0
 /// <summary>
 /// Called during TakeSnapshot in State to dump the data of this value
 /// </summary>
 /// <param name="ss"></param>
 public override void SaveData(StateSnapshot ss)
 {
     base.SaveData(ss);
     ss.WriteGuid(valueguid);
 }
Пример #20
0
        /// <summary>
        /// Take a snapshot of the state to a bytestream
        /// </summary>
        /// <returns></returns>
        private void TakeSnapshot()
        {
            // TODO: Incorporating snapshot with mark and sweep as they both traverse
            // the memory graph, althought it may be very complex
            StateSnapshot ss = new StateSnapshot(values);
            heap.TakeSnapshot(ss);
            ThreadState[] arr = threads.ToArray();
            /*			int i, j;
            for(i = 0; i < arr.Length; i++)
                for(j = i + 1; j < arr.Length; j++)
                    if(arr[i].ThreadStack.Count > arr[j].ThreadStack.Count)
                    {
                        ThreadState tmp = arr[i];
                        arr[i] = arr[j];
                        arr[j] = tmp;
                    }*/

            ss.WriteInt(arr.Length);
            for(int i = 0; i < arr.Length; i++)
                arr[i].TakeSnapshot(ss);
            snapshot = ss.GetStoringData();
            snapshotSig = md5.ComputeHash(snapshot);
        }
Пример #21
0
 public override void SaveData(StateSnapshot ss)
 {
     base.SaveData(ss);
     ss.WriteGuid(threadStartGUID);
 }