示例#1
0
        protected override void OnInitialize()
        {
            m_Pointer = m_MemoryReader.ReadPointer(address);

            // If it's a pointer, read the actual object type from the object in memory
            // and do not rely on the field type. The reason for this is that the field type
            // could be just the base-type or an interface, but the want to display the actual object type instead-
            var type = m_Snapshot.managedTypes[field.managedTypesArrayIndex];

            if (type.isPointer && m_Pointer != 0)
            {
                var i = m_Snapshot.FindManagedObjectTypeOfAddress(m_Pointer);
                if (i != -1)
                {
                    type = m_Snapshot.managedTypes[i];
                }
            }

            base.type    = type;
            displayName  = field.name;
            displayType  = type.name;
            displayValue = m_MemoryReader.ReadFieldValueAsString(address, type);
            isExpandable = false;// m_pointer > 0 && PackedManageTypeUtility.HasTypeOrBaseAnyInstanceField(m_snapshot, type);
            enabled      = m_Pointer > 0;
            icon         = HeEditorStyles.GetTypeImage(m_Snapshot, type);

            if (field.isStatic)
            {
                displayType = "static " + displayType;

                //PackedManagedType firstType;
                //if (PackedManageTypeUtility.HasTypeOrBaseAnyStaticField(m_snapshot, type, out firstType))
                //    allowExpand = m_pointer > 0 && firstType.managedTypeArrayIndex != type.managedTypeArrayIndex;
            }
            //else
            //{
            //    // HashString has a HashString static field (HashString.Empty)
            //    // The following line makes sure that we cannot infinitely expand the same type
            //    PackedManagedType firstType;
            //    if (PackedManageTypeUtility.HasTypeOrBaseAnyInstanceField(m_snapshot, type, out firstType))
            //        allowExpand = m_pointer > 0 && firstType.managedTypeArrayIndex != type.managedTypeArrayIndex;
            //}

            // HashString has a HashString static field (HashString.Empty)
            // The following line makes sure that we cannot infinitely expand the same type
            PackedManagedType firstType;

            if (PackedManagedTypeUtility.HasTypeOrBaseAnyInstanceField(m_Snapshot, type, out firstType))
            {
                isExpandable = m_Pointer > 0 && firstType.managedTypesArrayIndex != type.managedTypesArrayIndex;
            }
        }
示例#2
0
        protected override void OnInitialize()
        {
            displayType  = type.name;
            displayName  = "element";
            displayValue = m_MemoryReader.ReadFieldValueAsString(address, type);
            isExpandable = address > 0;
            icon         = HeEditorStyles.GetTypeImage(m_Snapshot, type);

            if (type.isPointer)
            {
                var pointer = m_MemoryReader.ReadPointer(address);
                isExpandable = pointer > 0;
                enabled      = pointer > 0;
            }
        }
示例#3
0
        protected override void OnInitialize()
        {
            var pointer     = m_MemoryReader.ReadPointer(address);
            var elementType = m_Snapshot.managedTypes[type.baseOrElementTypeIndex];
            var dim0Length  = address > 0 ? m_MemoryReader.ReadArrayLength(address, type, 0) : 0;

            displayType  = type.name;
            displayValue = "null";
            isExpandable = dim0Length > 0;
            enabled      = pointer > 0;
            icon         = HeEditorStyles.GetTypeImage(m_Snapshot, type);

            if (pointer != 0)
            {
                displayValue = elementType.name;

                var isJagged = type.name.IndexOf("[][]") != -1;
                if (isJagged)
                {
                    for (var n = 0; n < type.arrayRank; ++n)
                    {
                        var length = m_MemoryReader.ReadArrayLength(address, type, n);
                        displayValue += string.Format("[{0}]", length);
                    }
                }
                else
                {
                    displayValue += "[";
                    for (var n = 0; n < type.arrayRank; ++n)
                    {
                        var length = m_MemoryReader.ReadArrayLength(address, type, n);

                        displayValue += string.Format("{0}", length);
                        if (n + 1 < type.arrayRank)
                        {
                            displayValue += ",";
                        }
                    }
                    displayValue += "]";
                }
            }
        }
        protected override void OnInitialize()
        {
            var type = m_Snapshot.managedTypes[field.managedTypesArrayIndex];

            base.type = type;
            //typeIndex = type.managedTypesArrayIndex;
            displayType = type.name;
            if (field.isStatic)
            {
                displayType = "static " + displayType;
            }

            displayName  = field.name;
            displayValue = m_MemoryReader.ReadFieldValueAsString(address, type);
            isExpandable = false;
            icon         = HeEditorStyles.GetTypeImage(m_Snapshot, type);

            if (type.isPointer)
            {
                enabled = m_MemoryReader.ReadPointer(address) > 0;
            }
        }
示例#5
0
        protected override void OnInitialize()
        {
            type         = m_Snapshot.managedTypes[field.managedTypesArrayIndex];
            displayName  = field.name;
            displayType  = type.name;
            displayValue = m_MemoryReader.ReadFieldValueAsString(address, type);
            isExpandable = false;

            if (field.isStatic)
            {
                displayType = "static " + displayType;

                //PackedManagedType firstType;
                //if (PackedManageTypeUtility.HasTypeOrBaseAnyStaticField(m_snapshot, m_Type, out firstType))
                //    allowExpand = firstType.managedTypeArrayIndex != m_Type.managedTypeArrayIndex;
            }
            //else
            //{
            //    // HashString has a HashString static field (HashString.Empty)
            //    // The following line makes sure that we cannot infinitely expand the same type
            //    PackedManagedType firstType;
            //    if (PackedManageTypeUtility.HasTypeOrBaseAnyInstanceField(m_snapshot, m_Type, out firstType))
            //        allowExpand = firstType.managedTypeArrayIndex != m_Type.managedTypeArrayIndex;
            //}

            // HashString has a HashString static field (HashString.Empty)
            // The following line makes sure that we cannot infinitely expand the same type
            PackedManagedType firstType;

            if (PackedManagedTypeUtility.HasTypeOrBaseAnyInstanceField(m_Snapshot, type, out firstType))
            {
                isExpandable = firstType.managedTypesArrayIndex != type.managedTypesArrayIndex;
            }

            icon = HeEditorStyles.GetTypeImage(m_Snapshot, type);
        }