Ejemplo 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);
 }
Ejemplo 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);
 }
Ejemplo 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);
 }
Ejemplo 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);
            }
        }
Ejemplo 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);
            }
        }
Ejemplo 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);
            }
        }
Ejemplo 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);
            }
        }
Ejemplo 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);
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public FieldId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter, readerWriter.IdSizeInfo.FieldIdSize)
 {
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public ArrayTypeId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter)
 {
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public MethodId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter, readerWriter.IdSizeInfo.MethodIdSize)
 {
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public Location(JdwpPacket.DataReaderWriter readerWriter)
 {
     Class  = ReferenceTypeId.Read(readerWriter);
     Method = new MethodId(readerWriter);
     Index  = readerWriter.GetULong();
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public InterfaceId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter)
 {
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Read an untagged value.
 /// </summary>
 public Value(JdwpPacket.DataReaderWriter readerWriter, Jdwp.Tag tag)
 {
     Tag         = tag;
     ValueObject = ReadUntaggedValue(readerWriter, tag);
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public TaggedObjectId(JdwpPacket.DataReaderWriter readerWriter)
 {
     Tag    = (Jdwp.Tag)readerWriter.GetByte();
     Object = new ObjectId(readerWriter);
 }
Ejemplo 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);
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public ThreadId(JdwpPacket.DataReaderWriter readerWriter, int size)
     : base(readerWriter, size)
 {
 }
Ejemplo 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);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Read an value.
 /// </summary>
 protected ReferenceTypeId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter, readerWriter.IdSizeInfo.ReferenceTypeIdSize)
 {
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Read an value.
 /// </summary>
 protected ObjectId(JdwpPacket.DataReaderWriter readerWriter, int size)
     : base(readerWriter, size)
 {
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Read an value.
 /// </summary>
 protected ObjectId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter, readerWriter.IdSizeInfo.ObjectIdSize)
 {
 }
Ejemplo n.º 22
0
 /// <summary>
 /// writes slot and value.
 /// </summary>
 /// <param name="data"></param>
 public void Write(JdwpPacket.DataReaderWriter data)
 {
     data.SetInt(Slot);
     WriteValue(data);
 }
Ejemplo 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);
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public ThreadGroupId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter)
 {
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Read a tagged value.
 /// </summary>
 public Value(JdwpPacket.DataReaderWriter readerWriter)
 {
     Tag         = (Jdwp.Tag)readerWriter.GetByte();
     ValueObject = ReadUntaggedValue(readerWriter, Tag);
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public FrameId(JdwpPacket.DataReaderWriter readerWriter, IdSizeInfo sizeInfo)
     : base(readerWriter, sizeInfo.FrameIdSize)
 {
 }
Ejemplo 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);
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public ClassId(JdwpPacket.DataReaderWriter readerWriter)
     : base(readerWriter)
 {
 }
Ejemplo 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);
 }
Ejemplo 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);
 }