Inheritance: TargetFieldInfo
        internal TargetObject GetField(TargetMemoryAccess target, TargetLocation location,
                                       NativeFieldInfo field)
        {
            TargetLocation field_loc = location.GetLocationAtOffset(field.Offset);

            if (field.Type.IsByRef)
            {
                field_loc = field_loc.GetDereferencedLocation();
            }

            if (!field.Type.IsByRef && field.IsBitfield)
            {
                field_loc = new BitfieldTargetLocation(
                    field_loc, field.BitOffset, field.BitSize);
            }

            return(field.Type.GetObject(target, field_loc));
        }
        internal void SetField(TargetMemoryAccess target, TargetLocation location,
                               NativeFieldInfo field, TargetObject obj)
        {
            TargetLocation field_loc = location.GetLocationAtOffset(field.Offset);

            if (field.Type.IsByRef)
            {
                field_loc = field_loc.GetDereferencedLocation();
            }

            if (!field.Type.IsByRef && field.IsBitfield)
            {
                field_loc = new BitfieldTargetLocation(
                    field_loc, field.BitOffset, field.BitSize);
            }

            // field.Type.SetObject (field_loc, obj);
            throw new NotImplementedException();
        }
示例#3
0
        internal TargetObject GetField(TargetMemoryAccess target,
                                       TargetStructObject instance,
                                       TargetFieldInfo field)
        {
            TargetLocation field_loc = instance.Location.GetLocationAtOffset(field.Offset);

            if (field.Type.IsByRef)
            {
                field_loc = field_loc.GetDereferencedLocation();
            }

            NativeFieldInfo nfield = (NativeFieldInfo)field;

            if (!field.Type.IsByRef && nfield.IsBitfield)
            {
                field_loc = new BitfieldTargetLocation(
                    field_loc, nfield.BitOffset, nfield.BitSize);
            }

            return(field.Type.GetObject(target, field_loc));
        }
示例#4
0
        public override void SetField(Thread thread, TargetStructObject instance,
                                      TargetFieldInfo field, TargetObject value)
        {
            TargetLocation field_loc = instance.Location.GetLocationAtOffset(field.Offset);

            if (field.Type.IsByRef)
            {
                field_loc = field_loc.GetDereferencedLocation();
            }

            NativeFieldInfo nfield = (NativeFieldInfo)field;

            if (!field.Type.IsByRef && nfield.IsBitfield)
            {
                field_loc = new BitfieldTargetLocation(
                    field_loc, nfield.BitOffset, nfield.BitSize);
            }

            // field.Type.SetObject (field_loc, value);
            throw new NotImplementedException();
        }
示例#5
0
 internal NativeClass(NativeStructType type, NativeFieldInfo[] fields)
 {
     this.type = type;
     this.fields = fields != null ? fields : new NativeFieldInfo [0];
 }
示例#6
0
            protected override void PopulateType()
            {
                if (!abbrev.HasChildren)
                    return;

                ArrayList list = new ArrayList ();

                foreach (Die child in Children) {
                    DieMember member = child as DieMember;
                    if ((member == null) || !member.Resolve (this))
                        continue;

                    TargetType mtype = member.Type;
                    if (mtype == null)
                        mtype = (TargetType) language.VoidType;

                    NativeFieldInfo field;
                    if (member.IsBitfield)
                        field = new NativeFieldInfo (
                            mtype, member.Name, list.Count,
                            member.DataOffset, member.BitOffset,
                            member.BitSize);
                    else
                        field = new NativeFieldInfo (
                            mtype, member.Name, list.Count,
                            member.DataOffset);
                    list.Add (field);
                }

                fields = new NativeFieldInfo [list.Count];
                list.CopyTo (fields);

                type.SetFields (fields);
            }
示例#7
0
 internal void SetFields(NativeFieldInfo[] fields)
 {
     this.fields = fields;
 }
示例#8
0
        internal void SetField(TargetMemoryAccess target, TargetLocation location,
					NativeFieldInfo field, TargetObject obj)
        {
            TargetLocation field_loc = location.GetLocationAtOffset (field.Offset);

            if (field.Type.IsByRef)
                field_loc = field_loc.GetDereferencedLocation ();

            if (!field.Type.IsByRef && field.IsBitfield)
                field_loc = new BitfieldTargetLocation (
                    field_loc, field.BitOffset, field.BitSize);

            // field.Type.SetObject (field_loc, obj);
            throw new NotImplementedException ();
        }
示例#9
0
        internal TargetObject GetField(TargetMemoryAccess target, TargetLocation location,
						NativeFieldInfo field)
        {
            TargetLocation field_loc = location.GetLocationAtOffset (field.Offset);

            if (field.Type.IsByRef)
                field_loc = field_loc.GetDereferencedLocation ();

            if (!field.Type.IsByRef && field.IsBitfield)
                field_loc = new BitfieldTargetLocation (
                    field_loc, field.BitOffset, field.BitSize);

            return field.Type.GetObject (target, field_loc);
        }
示例#10
0
        internal NativeStructType(Language language, string name,
					   NativeFieldInfo[] fields, int size)
            : this(language, name, size)
        {
            this.fields = fields;
        }