Example #1
0
		void AddLoadedBlock (LoadedBlock block)
		{
			if (block.IsAssembly) {
				if (block.Id >= assemblies.Length) {
					AssemblyInfo[] grow = new AssemblyInfo [((block.Id / 10) + 1) * 10];
					assemblies.CopyTo (grow, 0);
					assemblies = grow;
				}
				assemblies [block.Id] = block.Assembly;
			}
		}
Example #2
0
			public ClassItem (uint id, AssemblyInfo assembly, string name)
			{
				this.id = id;
				this.assembly = assembly;
				this.name = name;
			}
Example #3
0
        internal LoadedBlock(Buffer raw, DirectivesBlock directives)
            : base(BlockCode.Loaded)
        {
            kind = raw.ReadByte ();
            start_counter = raw.ReadUlong ();
            end_counter = raw.ReadUlong ();
            thread_id = raw.ReadUlong ();
            if (directives.LoadedElementsCarryId)
                id = raw.ReadUint ();
            item_name = raw.ReadString ();

            success = ((kind & (byte)LoadedItemInfo.SUCCESS) != 0);
            kind &= (byte) (LoadedItemInfo.APPDOMAIN|LoadedItemInfo.ASSEMBLY|LoadedItemInfo.MODULE);

            switch ((LoadedItemInfo) kind) {
            case LoadedItemInfo.APPDOMAIN:
                is_appdomain = true;
                break;
            case LoadedItemInfo.MODULE:
                is_module = true;
                break;
            case LoadedItemInfo.ASSEMBLY:
                is_assembly = true;
                if (directives.ClassesCarryAssemblyId)
                    assembly_info = new AssemblyInfo (raw.ReadString (), raw.ReadUint (), raw.ReadUint (), raw.ReadUint (), raw.ReadUint (), raw.ReadString (), raw.ReadString (), raw.ReadUint () != 0);
                else {
                    int commaPosition = item_name.IndexOf (',');
                    assembly_info = new AssemblyInfo (commaPosition > 0 ? item_name.Substring (0, commaPosition) : "UNKNOWN");
                }
                break;
            default:
                throw new Exception (String.Format ("unknown load event kind {0}", kind));
            }
            if (!raw.IsEmpty)
                throw new Exception ("Unexpected data remaining in block");
        }