This commit is contained in:
kudzu_cp 2011-07-18 03:03:29 +00:00
parent 819f8b042d
commit be9dbc0f4a

View file

@ -647,55 +647,14 @@ namespace Cosmos.Compiler.DebugStub {
// Get AL back so we can compare it, but also put it back for later // Get AL back so we can compare it, but also put it back for later
EAX = Memory[ESP]; EAX = Memory[ESP];
CheckCmd(DsCommand.TraceOff, typeof(TraceOff));
AL.Compare(DsCommand.TraceOff); CheckCmd(DsCommand.TraceOn, typeof(TraceOn));
JumpIf(Flags.NotEqual, ".TraceOffAfter"); CheckCmd(DsCommand.Break, typeof(Break));
Memory["DebugTraceMode", 32] = Tracing.Off; CheckCmd(DsCommand.BreakOnAddress, typeof(BreakOnAddress));
Jump(".SendACK"); CheckCmd(DsCommand.SendMethodContext, typeof(SendMethodContext));
Label = ".TraceOffAfter"; CheckCmd(DsCommand.SendMemory, typeof(SendMemory));
CheckCmd(DsCommand.SendRegisters, typeof(SendRegisters));
AL.Compare(DsCommand.TraceOn); CheckCmd(DsCommand.SendFrame, typeof(SendFrame));
JumpIf(Flags.NotEqual, ".TraceOnAfter");
Memory["DebugTraceMode", 32] = Tracing.On;
Jump(".SendACK");
Label = ".TraceOnAfter";
AL.Compare(DsCommand.Break);
JumpIf(Flags.NotEqual, ".BreakAfter");
Call<Break>();
Jump(".SendACK");
Label = ".BreakAfter";
AL.Compare(DsCommand.BreakOnAddress);
JumpIf(Flags.NotEqual, ".BreakOnAddressAfter");
Call<BreakOnAddress>();
Jump(".SendACK");
Label = ".BreakOnAddressAfter";
AL.Compare(DsCommand.SendMethodContext);
JumpIf(Flags.NotEqual, ".SendMethodContextAfter");
Call<SendMethodContext>();
Jump(".SendACK");
Label = ".SendMethodContextAfter";
AL.Compare(DsCommand.SendMemory);
JumpIf(Flags.NotEqual, ".SendMemoryAfter");
Call<SendMemory>();
Jump(".SendACK");
Label = ".SendMemoryAfter";
AL.Compare(DsCommand.SendRegisters);
JumpIf(Flags.NotEqual, ".SendRegistersAfter");
Call<SendRegisters>();
Jump(".SendACK");
Label = ".SendRegistersAfter";
AL.Compare(DsCommand.SendFrame);
JumpIf(Flags.NotEqual, ".SendFrameAfter");
Call<SendFrame>();
Jump(".SendACK");
Label = ".SendFrameAfter";
CheckCmd(DsCommand.SendStack, typeof(SendStack)); CheckCmd(DsCommand.SendStack, typeof(SendStack));
Label = ".SendACK"; Label = ".SendACK";
@ -731,6 +690,18 @@ namespace Cosmos.Compiler.DebugStub {
} }
} }
public class TraceOff : CodeBlock {
public override void Assemble() {
Memory["DebugTraceMode", 32] = Tracing.Off;
}
}
public class TraceOn : CodeBlock {
public override void Assemble() {
Memory["DebugTraceMode", 32] = Tracing.On;
}
}
public class Executing : CodeBlock { public class Executing : CodeBlock {
// This is the secondary stub routine. After the primary (main) has decided we should do some debug // This is the secondary stub routine. After the primary (main) has decided we should do some debug
// activities, this one is called. // activities, this one is called.