Example #1
0
        internal void MonoArrayTypeGetBounds(TargetMemoryAccess memory,
                                             TargetAddress data)
        {
            //
            // FIXME: Only check whether the low bounds are all zero
            //
            int num_sizes = memory.ReadByte(data + memory.TargetAddressSize + 1);

            if (num_sizes != 0)
            {
                throw new InternalError();
            }

            int num_lobounds = memory.ReadByte(data + memory.TargetAddressSize + 2);

            if (num_lobounds == 0)
            {
                return;
            }

            TargetAddress      array  = memory.ReadAddress(data + 3 * memory.TargetAddressSize);
            TargetBinaryReader bounds = memory.ReadMemory(array, num_lobounds * 4).GetReader();

            for (int i = 0; i < num_lobounds; i++)
            {
                int bound = bounds.ReadInt32();
                if (bound != 0)
                {
                    throw new InternalError();
                }
            }
        }
 internal override bool IsSyscallInstruction(TargetMemoryAccess memory,
                                             TargetAddress address)
 {
     try {
         return((memory.ReadByte(address - 2) == 0x0f) &&
                (memory.ReadByte(address - 1) == 0x05));
     } catch {
         return(false);
     }
 }
Example #3
0
 public int MonoArrayTypeGetNumLoBounds(TargetMemoryAccess memory,
                                        TargetAddress atype)
 {
     return(memory.ReadByte(atype + memory.TargetAddressSize + 2));
 }
Example #4
0
 public int MonoArrayTypeGetRank(TargetMemoryAccess memory,
                                 TargetAddress atype)
 {
     return(memory.ReadByte(atype + memory.TargetAddressSize));
 }
Example #5
0
        internal override bool IsSyscallInstruction(TargetMemoryAccess memory,
							     TargetAddress address)
        {
            try {
                return (memory.ReadByte (address - 2) == 0x0f) &&
                    (memory.ReadByte (address - 1) == 0x05);
            } catch {
                return false;
            }
        }
Example #6
0
        internal override bool IsRetInstruction(TargetMemoryAccess memory,
							 TargetAddress address)
        {
            return memory.ReadByte (address) == 0xc3;
        }
 internal override bool IsRetInstruction(TargetMemoryAccess memory,
                                         TargetAddress address)
 {
     return(memory.ReadByte(address) == 0xc3);
 }
Example #8
0
        internal void MonoArrayTypeGetBounds(TargetMemoryAccess memory,
						      TargetAddress data)
        {
            //
            // FIXME: Only check whether the low bounds are all zero
            //
            int num_sizes = memory.ReadByte (data + memory.TargetAddressSize + 1);
            if (num_sizes != 0)
                throw new InternalError ();

            int num_lobounds = memory.ReadByte (data + memory.TargetAddressSize + 2);
            if (num_lobounds == 0)
                return;

            TargetAddress array = memory.ReadAddress (data + 3 * memory.TargetAddressSize);
            TargetBinaryReader bounds = memory.ReadMemory (array, num_lobounds * 4).GetReader ();
            for (int i = 0; i < num_lobounds; i++) {
                int bound = bounds.ReadInt32 ();
                if (bound != 0)
                    throw new InternalError ();
            }
        }
Example #9
0
        public int MonoArrayTypeGetRank(TargetMemoryAccess memory,
						 TargetAddress atype)
        {
            return memory.ReadByte (atype + memory.TargetAddressSize);
        }
Example #10
0
        public int MonoArrayTypeGetNumLoBounds(TargetMemoryAccess memory,
							TargetAddress atype)
        {
            return memory.ReadByte (atype + memory.TargetAddressSize + 2);
        }