예제 #1
0
        public override bool Equals(System.Object object_Renamed)
        {
            bool isIt = (object_Renamed is RegisterRecord);

            if (isIt)
            {
                RegisterRecord other = (RegisterRecord)object_Renamed;
                isIt = base.Equals(other);
                for (int i = 0; isIt && i < registerNumbers.Length; i++)
                {
                    isIt = ((other.registerNumbers[i] == this.registerNumbers[i]) && ((System.Object)other.variableNames[i] == (System.Object) this.variableNames[i]))?isIt:false;
                }
            }
            return(isIt);
        }
		public virtual void  registerRecord(RegisterRecord line)
		{
		}
		public override void  registerRecord(RegisterRecord record)
		{
			// set the active record
			registerRecord_Renamed_Field = record;
		}
예제 #4
0
 public override void registers(int offset, RegisterRecord r)
 {
     registers_Renamed_Field.put(offset, r);
 }
예제 #5
0
            public override void registers(int offset, RegisterRecord r)
			{
				Console.Out.WriteLine("DebugRegisters " + r.ToString());
			}
예제 #6
0
		public virtual void  readTags(DebugHandler handler)
		{
			System.Collections.ArrayList lineRecords = new System.Collections.ArrayList();
			
			do 
			{
				int tag = (int) in_Renamed.readUI32();
				switch (tag)
				{
					
					case kDebugScript: 
						DebugModule m = new DebugModule();
						int id = (int) in_Renamed.readUI32();
						m.id = id;
						m.bitmap = (int) in_Renamed.readUI32();
						m.name = in_Renamed.readString();
						m.Text = in_Renamed.readString();
						
						adjustModuleName(m);
						
						if (modules.contains(id))
						{
							DebugModule m2 = (DebugModule) modules.get_Renamed(id);
							if (!m.Equals(m2))
							{
								handler.error("Module '" + m2.name + "' has the same ID as Module '" + m.name + "'");
								handler.error("Let's check for kDebugOffset that came before Module '" + m2.name + "'");
								handler.error("Before: Number of accumulated line records: " + lineRecords.Count);
								lineRecords = purgeLineRecords(lineRecords, id, handler);
								handler.error("After: Number of accumulated line records: " + lineRecords.Count);
							}
						}
						modules.put(id, m);
						handler.module(m);
						break;
					
					case kDebugOffset: 
						id = (int) in_Renamed.readUI32();
						int lineno = (int) in_Renamed.readUI32();
						DebugModule module = (DebugModule) modules.get_Renamed(id);
						LineRecord lr = new LineRecord(lineno, module);
						int offset = (int) in_Renamed.readUI32();
						
						if (module != null)
						{
							// not corrupted before we add the offset and offset add fails
							bool wasCorrupt = module.corrupt;
							if (!module.addOffset(lr, offset) && !wasCorrupt)
								handler.error(module.name + ":" + lineno + " does not exist for offset " + offset + ", module marked for exclusion from debugging");
							handler.offset(offset, lr);
						}
						else
						{
							lineRecords.Add((System.Int32) id);
							lineRecords.Add(lr);
							lineRecords.Add((System.Int32) offset);
						}
						break;
					
					case kDebugBreakpoint: 
						handler.breakpoint((int) in_Renamed.readUI32());
						break;
					
					case kDebugRegisters: 
					{
						offset = (int) in_Renamed.readUI32();
						int size = in_Renamed.readUI8();
						RegisterRecord r = new RegisterRecord(offset, size);
						for (int i = 0; i < size; i++)
						{
							int nbr = in_Renamed.readUI8();
							String name = in_Renamed.readString();
							r.addRegister(nbr, name);
						}
						handler.registers(offset, r);
						break;
					}
					
					
					case kDebugID: 
						FlashUUID uuid = new FlashUUID();
						in_Renamed.readFully(uuid.bytes);
						handler.uuid(uuid);
						break;
					
					case - 1: 
						break;
					
					default: 
						throw new SwfFormatException("Unexpected tag id " + tag);
					
				}
				
				if (tag == - 1)
				{
					break;
				}
			}
			while (true);
			
			int i2 = 0, size2 = lineRecords.Count;
			while (i2 < size2)
			{
				int id = ((System.Int32) lineRecords[i2]);
				LineRecord lr = (LineRecord) lineRecords[i2 + 1];
				int offset = ((System.Int32) lineRecords[i2 + 2]);
				lr.module = (DebugModule) modules.get_Renamed(id);
				
				if (lr.module != null)
				{
					//System.out.println("updated module "+id+" out of order");
					// not corrupted before we add the offset and offset add fails
					bool wasCorrupt = lr.module.corrupt;
					if (!lr.module.addOffset(lr, offset) && !wasCorrupt)
						handler.error(lr.module.name + ":" + lr.lineno + " does not exist for offset " + offset + ", module marked for exclusion from debugging");
					
					handler.offset(offset, lr);
				}
				else
				{
					handler.error("Could not find debug module (id = " + id + ") for offset = " + offset);
				}
				
				i2 += 3;
			}
		}
예제 #7
0
 public abstract void registers(int offset, RegisterRecord r);
예제 #8
0
        public override void registers(int offset, RegisterRecord r)
		{
			registers_Renamed_Field.put(offset, r);
		}