Esempio n. 1
0
        private void OnReplyPacketReceived(byte[] packetBytes)
        {
            ReplyPacketParser packet = new ReplyPacketParser(packetBytes, _IDSizes);
            uint id = packet.Id;

            WaitingOperationDescriptor waitingOperation = null;

            lock (_waitingOperations)
            {
                if (_waitingOperations.TryGetValue(id, out waitingOperation))
                {
                    _waitingOperations.Remove(id);
                }
            }
            if (waitingOperation != null)
            {
                try
                {
                    waitingOperation.OnComplete(packet);
                }
                catch (JdwpException e)
                {
                    waitingOperation.OnJdwpException(e);
                }
            }
            else
            {
                Debug.Fail("How did we get a reply packet that we don't have a waiting operation for?");
            }
        }
Esempio n. 2
0
 internal override void DecodeSuccessReply(ReplyPacketParser reply)
 {
     _reply             = new Reply();
     _reply.description = reply.ReadString();
     _reply.jdwpMajor   = (int)reply.ReadUInt32();
     _reply.jdwpMinor   = (int)reply.ReadUInt32();
     _reply.vmVersion   = reply.ReadString();
     _reply.vmName      = reply.ReadString();
 }
Esempio n. 3
0
        internal override void DecodeSuccessReply(ReplyPacketParser bytes)
        {
            int fieldIDSize         = (int)bytes.ReadUInt32();
            int methodIDSize        = (int)bytes.ReadUInt32();
            int objectIDsize        = (int)bytes.ReadUInt32();
            int referenceTypeIDSize = (int)bytes.ReadUInt32();
            int frameIDSize         = (int)bytes.ReadUInt32();

            _reply = new IDSizes(fieldIDSize, methodIDSize, objectIDsize, referenceTypeIDSize, frameIDSize);
        }
Esempio n. 4
0
 internal void OnComplete(ReplyPacketParser replyPacket)
 {
     if (replyPacket.Succeeded)
     {
         _command.DecodeSuccessReply(replyPacket);
         _completionSource.SetResult(null);
     }
     else
     {
         _command.DecodeFailureReply(replyPacket);
         _completionSource.SetException(new JdwpException(ErrorCode.CommandFailure, string.Format(CultureInfo.CurrentCulture, "JDWP Error. Id: {0} Error Code: {1}", replyPacket.Id, replyPacket.ErrorCode)));
     }
 }
Esempio n. 5
0
        internal override void DecodeSuccessReply(ReplyPacketParser bytes)
        {
            int countClasses = (int)bytes.ReadUInt32();

            _classData = new List <ClassData>();
            for (int i = 0; i < countClasses; i++)
            {
                ClassData classData = new ClassData();
                classData.refTypeFlag      = bytes.ReadByte();
                classData.typeID           = bytes.ReadReferenceTypeID();
                classData.signature        = bytes.ReadString();
                classData.genericSignature = bytes.ReadString();
                classData.status           = (int)bytes.ReadUInt32();

                _classData.Add(classData);
            }
        }
Esempio n. 6
0
        private void OnReplyPacketReceived(byte[] packetBytes)
        {
            ReplyPacketParser packet = new ReplyPacketParser(packetBytes, _IDSizes);
            uint id = packet.Id;

            WaitingOperationDescriptor waitingOperation = null;
            lock (_waitingOperations)
            {
                if (_waitingOperations.TryGetValue(id, out waitingOperation))
                {
                    _waitingOperations.Remove(id);
                }
            }
            if (waitingOperation != null)
            {
                try
                {
                    waitingOperation.OnComplete(packet);
                }
                catch (JdwpException e)
                {
                    waitingOperation.OnJdwpException(e);
                }
            }
            else
            {
                Debug.Fail("How did we get a reply packet that we don't have a waiting operation for?");
            }
        }
Esempio n. 7
0
 internal void OnComplete(ReplyPacketParser replyPacket)
 {
     if (replyPacket.Succeeded)
     {
         _command.DecodeSuccessReply(replyPacket);
         _completionSource.SetResult(null);
     }
     else
     {
         _command.DecodeFailureReply(replyPacket);
         _completionSource.SetException(new JdwpException(ErrorCode.CommandFailure, string.Format(CultureInfo.CurrentCulture, "JDWP Error. Id: {0} Error Code: {1}", replyPacket.Id, replyPacket.ErrorCode)));
     }
 }
Esempio n. 8
0
 internal virtual void DecodeFailureReply(ReplyPacketParser bytes)
 {
 }
Esempio n. 9
0
 //overriden by commands that need to decode reply payloads
 internal virtual void DecodeSuccessReply(ReplyPacketParser bytes)
 {
 }