Second breakpoint bug fixed.

This commit is contained in:
kudzu_cp 2012-01-15 22:06:09 +00:00
parent 6f7e16fb55
commit d5a1bb2f45
2 changed files with 11 additions and 6 deletions

View file

@ -410,13 +410,13 @@ namespace Cosmos.Debug.Common {
}
protected void PacketTracePoint(byte[] aPacket) {
// Seems to need to be ebfore CmdTrace call - have to dig why by moving it breaks things
// Moving it after the cmd causes a lockup.. not sure why... need to check
WaitForMessage();
CmdTrace(mCurrentMsgType, GetUInt32(aPacket, 0));
}
protected void PacketText(byte[] aPacket) {
// Seems to need to be ebfore CmdTrace call - have to dig why by moving it breaks things
// Moving it after the cmd causes a lockup.. not sure why... need to check
WaitForMessage();
CmdText(ASCIIEncoding.ASCII.GetString(aPacket));
}

View file

@ -55,17 +55,22 @@ namespace Cosmos.Debug.Common {
base.Dispose();
}
protected Action<byte[]> mCompleted; // Action to call after size received
protected Action<byte[]> mCompletedAfterSize; // Action to call after size received
protected void SizePacket(byte[] aPacket) {
int xSize = aPacket[0] + (aPacket[1] << 8);
Next(xSize, mCompleted);
Next(xSize, mCompletedAfterSize);
}
protected override void Next(int aPacketSize, Action<byte[]> aCompleted) {
var xIncoming = new Incoming();
if (aPacketSize == -1) {
if (aPacketSize == 0) {
// Can occur with variable size packets for exampmle.
// Dont call read, becuase that will close the stream.
// So we just call the Completed directly
aCompleted(new byte[0]);
} else if (aPacketSize == -1) {
// Variable size packet, split into two reads
mCompleted = aCompleted;
mCompletedAfterSize = aCompleted;
aPacketSize = 2;
xIncoming.Completed = SizePacket;
} else {