Пример #1
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);
            }
        }
Пример #2
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);
            }
        }
Пример #3
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public TaggedObjectId(JdwpPacket.DataReaderWriter readerWriter)
 {
     Tag    = (Jdwp.Tag)readerWriter.GetByte();
     Object = new ObjectId(readerWriter);
 }
Пример #4
0
 /// <summary>
 /// Read a tagged value.
 /// </summary>
 public Value(JdwpPacket.DataReaderWriter readerWriter)
 {
     Tag         = (Jdwp.Tag)readerWriter.GetByte();
     ValueObject = ReadUntaggedValue(readerWriter, Tag);
 }