Esempio n. 1
0
 /// <summary>
 /// Write the modifier to the writer of a packet.
 /// In this method the kind byte is written override to write additional data.
 /// </summary>
 internal override void WriteTo(JdwpPacket.DataReaderWriter writer)
 {
     base.WriteTo(writer);
     threadId.WriteTo(writer);
     writer.SetInt((int)stepSize);
     writer.SetInt((int)stepDepth);
 }
Esempio n. 2
0
 /// <summary>
 /// Write this location into the given packet writer.
 /// </summary>
 public void WriteTo(JdwpPacket.DataReaderWriter writer)
 {
     writer.SetByte((byte)GetType(Class));
     Class.WriteTo(writer);
     Method.WriteTo(writer);
     writer.SetULong(Index);
 }
Esempio n. 3
0
 /// <summary>
 /// Write the modifier to the writer of a packet.
 /// In this method the kind byte is written override to write additional data.
 /// </summary>
 internal override void WriteTo(JdwpPacket.DataReaderWriter writer)
 {
     base.WriteTo(writer);
     exceptionClassId.WriteTo(writer);
     writer.SetBoolean(caught);
     writer.SetBoolean(uncaught);
 }
Esempio n. 4
0
        /// <summary>
        /// Write this ID into the given packet writer.
        /// </summary>
        public void WriteTo(JdwpPacket.DataReaderWriter readerWriter)
        {
            switch (idSize)
            {
            case 4:
                readerWriter.SetInt((int)id);
                break;

            case 8:
                readerWriter.SetLong(id);
                break;

            default:
                throw new ArgumentException("Unsupported ID size " + idSize);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Read an value.
        /// </summary>
        protected Id(JdwpPacket.DataReaderWriter readerWriter, int idSize)
        {
            this.idSize = idSize;
            switch (idSize)
            {
            case 4:
                id = readerWriter.GetInt();
                break;

            case 8:
                id = readerWriter.GetLong();
                break;

            default:
                throw new ArgumentException("Unsupported ID size " + idSize);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Read an untagged value.
        /// </summary>
        private static object ReadUntaggedValue(JdwpPacket.DataReaderWriter readerWriter, Jdwp.Tag tag)
        {
            switch (tag)
            {
            case Jdwp.Tag.Array:
            case Jdwp.Tag.Object:
            case Jdwp.Tag.String:
            case Jdwp.Tag.Thread:
            case Jdwp.Tag.ThreadGroup:
            case Jdwp.Tag.ClassLoader:
            case Jdwp.Tag.ClassObject:
                return(new ObjectId(readerWriter));

            case Jdwp.Tag.Byte:
                return(readerWriter.GetByte());

            case Jdwp.Tag.Char:
                return((char)readerWriter.GetInt16());

            case Jdwp.Tag.Float:
                return(readerWriter.GetFloat());

            case Jdwp.Tag.Double:
                return(readerWriter.GetDouble());

            case Jdwp.Tag.Int:
                return(readerWriter.GetInt());

            case Jdwp.Tag.Long:
                return(readerWriter.GetLong());

            case Jdwp.Tag.Short:
                return(readerWriter.GetInt16());

            case Jdwp.Tag.Void:
                return(null);

            case Jdwp.Tag.Boolean:
                return(readerWriter.GetBoolean());

            default:
                throw new ArgumentException("Unknown tag " + (int)tag);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Read an untagged value.
        /// </summary>
        private static void WriteValue(JdwpPacket.DataReaderWriter data, Jdwp.Tag tag, object obj)
        {
            switch (tag)
            {
            //case Jdwp.Tag.Array:
            //case Jdwp.Tag.Object:
            //case Jdwp.Tag.String:
            //case Jdwp.Tag.Thread:
            //case Jdwp.Tag.ThreadGroup:
            //case Jdwp.Tag.ClassLoader:
            //case Jdwp.Tag.ClassObject:
            //    return new ObjectId(readerWriter);
            case Jdwp.Tag.Byte:
                data.SetByte((byte)obj);
                break;

            case Jdwp.Tag.Short:
            case Jdwp.Tag.Char:
                data.SetInt16((int)obj);
                break;

            //case Jdwp.Tag.Float:
            //    readerWriter.GetFloat(); //?
            //    break;
            //case Jdwp.Tag.Double:
            //    return readerWriter.SetDouble(); //?
            case Jdwp.Tag.Int:
                data.SetInt((int)obj);
                break;

            case Jdwp.Tag.Long:
                data.SetLong((long)obj);
                break;

            case Jdwp.Tag.Boolean:
                data.SetBoolean((bool)obj);
                break;

            default:
                throw new ArgumentException("unsupported tag " + tag);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Read a (byte) TypeTag followed by a reference type id.
        /// </summary>
        internal static ReferenceTypeId Read(JdwpPacket.DataReaderWriter reader)
        {
            var tag = (Jdwp.TypeTag)reader.GetByte();

            switch (tag)
            {
            case 0:
                var dummy = new ClassId(reader);
                return(new ClassId(reader.IdSizeInfo));

            case Jdwp.TypeTag.Class:
                return(new ClassId(reader));

            case Jdwp.TypeTag.Interface:
                return(new InterfaceId(reader));

            case Jdwp.TypeTag.Array:
                return(new ArrayTypeId(reader));

            default:
                throw new ArgumentException("Unknown type tag " + (int)tag);
            }
        }
Esempio n. 9
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public FieldId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter, readerWriter.IdSizeInfo.FieldIdSize)
 {
 }
Esempio n. 10
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public ArrayTypeId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter)
 {
 }
Esempio n. 11
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public MethodId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter, readerWriter.IdSizeInfo.MethodIdSize)
 {
 }
Esempio n. 12
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public Location(JdwpPacket.DataReaderWriter readerWriter)
 {
     Class  = ReferenceTypeId.Read(readerWriter);
     Method = new MethodId(readerWriter);
     Index  = readerWriter.GetULong();
 }
Esempio n. 13
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public InterfaceId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter)
 {
 }
Esempio n. 14
0
 /// <summary>
 /// Read an untagged value.
 /// </summary>
 public Value(JdwpPacket.DataReaderWriter readerWriter, Jdwp.Tag tag)
 {
     Tag         = tag;
     ValueObject = ReadUntaggedValue(readerWriter, tag);
 }
Esempio n. 15
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public TaggedObjectId(JdwpPacket.DataReaderWriter readerWriter)
 {
     Tag    = (Jdwp.Tag)readerWriter.GetByte();
     Object = new ObjectId(readerWriter);
 }
Esempio n. 16
0
 /// <summary>
 /// Write the modifier to the writer of a packet.
 /// In this method the kind byte is written override to write additional data.
 /// </summary>
 internal override void WriteTo(JdwpPacket.DataReaderWriter writer)
 {
     base.WriteTo(writer);
     classId.WriteTo(writer);
     fieldId.WriteTo(writer);
 }
Esempio n. 17
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public ThreadId(JdwpPacket.DataReaderWriter readerWriter, int size)
     : base(readerWriter, size)
 {
 }
Esempio n. 18
0
 /// <summary>
 /// Write the modifier to the writer of a packet.
 /// In this method the kind byte is written override to write additional data.
 /// </summary>
 internal override void WriteTo(JdwpPacket.DataReaderWriter writer)
 {
     base.WriteTo(writer);
     writer.SetInt(count);
 }
Esempio n. 19
0
 /// <summary>
 /// Read an value.
 /// </summary>
 protected ReferenceTypeId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter, readerWriter.IdSizeInfo.ReferenceTypeIdSize)
 {
 }
Esempio n. 20
0
 /// <summary>
 /// Read an value.
 /// </summary>
 protected ObjectId(JdwpPacket.DataReaderWriter readerWriter, int size)
     : base(readerWriter, size)
 {
 }
Esempio n. 21
0
 /// <summary>
 /// Read an value.
 /// </summary>
 protected ObjectId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter, readerWriter.IdSizeInfo.ObjectIdSize)
 {
 }
Esempio n. 22
0
 /// <summary>
 /// writes slot and value.
 /// </summary>
 /// <param name="data"></param>
 public void Write(JdwpPacket.DataReaderWriter data)
 {
     data.SetInt(Slot);
     WriteValue(data);
 }
Esempio n. 23
0
 /// <summary>
 /// Write the modifier to the writer of a packet.
 /// In this method the kind byte is written override to write additional data.
 /// </summary>
 internal override void WriteTo(JdwpPacket.DataReaderWriter writer)
 {
     base.WriteTo(writer);
     instanceId.WriteTo(writer);
 }
Esempio n. 24
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public ThreadGroupId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter)
 {
 }
Esempio n. 25
0
 /// <summary>
 /// Read a tagged value.
 /// </summary>
 public Value(JdwpPacket.DataReaderWriter readerWriter)
 {
     Tag         = (Jdwp.Tag)readerWriter.GetByte();
     ValueObject = ReadUntaggedValue(readerWriter, Tag);
 }
Esempio n. 26
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public FrameId(JdwpPacket.DataReaderWriter readerWriter, IdSizeInfo sizeInfo)
     : base(readerWriter, sizeInfo.FrameIdSize)
 {
 }
Esempio n. 27
0
 /// <summary>
 /// Write the modifier to the writer of a packet.
 /// In this method the kind byte is written override to write additional data.
 /// </summary>
 internal virtual void WriteTo(JdwpPacket.DataReaderWriter writer)
 {
     writer.SetByte((byte)kind);
 }
Esempio n. 28
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public ClassId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter)
 {
 }
Esempio n. 29
0
 /// <summary>
 /// Write this location into the given packet writer.
 /// </summary>
 public void WriteTo(JdwpPacket.DataReaderWriter writer)
 {
     writer.SetByte((byte)Tag);
     Object.WriteTo(writer);
 }
Esempio n. 30
0
 /// <summary>
 /// writes only the value, without the slot.
 /// </summary>
 /// <param name="data"></param>
 public void WriteValue(JdwpPacket.DataReaderWriter data)
 {
     data.SetByte((byte)Tag);
     WriteValue(data, Tag, Value);
 }