Ejemplo n.º 1
0
        internal void SetObject(StackFrame frame, TargetMemoryAccess target,
                                TargetObject obj)
        {
            TargetLocation location = GetLocation(frame, target);

            if (location == null)
            {
                throw new LocationInvalidException();
            }

            type.SetObject(target, location, (TargetObject)obj);
        }
Ejemplo n.º 2
0
        internal void SetStaticField(TargetMemoryAccess target, TargetFieldInfo field,
                                     TargetAddress data_address, TargetObject obj)
        {
            GetFields(target);

            int        offset = field_offsets [field.Position];
            TargetType type   = field_types [field.Position];

            TargetLocation location  = new AbsoluteTargetLocation(data_address);
            TargetLocation field_loc = location.GetLocationAtOffset(offset);

            if (type.IsByRef)
            {
                field_loc = field_loc.GetDereferencedLocation();
            }

            type.SetObject(target, field_loc, obj);
        }
Ejemplo n.º 3
0
        internal void SetInstanceField(TargetMemoryAccess target,
                                       TargetStructObject instance,
                                       TargetFieldInfo field, TargetObject obj)
        {
            GetFields(target);

            int        offset = field_offsets [field.Position];
            TargetType type   = field_types [field.Position];

            if (!Type.IsByRef)
            {
                offset -= 2 * target.TargetMemoryInfo.TargetAddressSize;
            }
            TargetLocation field_loc = instance.Location.GetLocationAtOffset(offset);

            if (type.IsByRef)
            {
                field_loc = field_loc.GetDereferencedLocation();
            }

            type.SetObject(target, field_loc, obj);
        }