diff --git a/source/Cosmos.sln b/source/Cosmos.sln index 9e1adc516..84d477889 100644 --- a/source/Cosmos.sln +++ b/source/Cosmos.sln @@ -92,7 +92,7 @@ Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Docs", "..\Docs", "{67E7DEF Release.AspNetCompiler.ForceOverwrite = "true" Release.AspNetCompiler.FixedNames = "false" Release.AspNetCompiler.Debug = "False" - VWDPort = "1091" + VWDPort = "52631" EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Debug.Consts", "..\source2\IL2CPU\Cosmos.IL2CPU.Debug\Cosmos.Debug.Consts.csproj", "{9998B4EA-385E-4DA2-8905-2BBEB5B2C6E2}" diff --git a/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.asm b/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.asm index 7070668eb..9a2379351 100644 --- a/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.asm +++ b/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.asm @@ -1,11 +1,11 @@ -DebugStub_ProcessCommand2: +DebugStub_ProcessCommandNew: Call DebugStub_ComReadAL Push EAX Cmp AL, DebugStub_Const_Vs2Ds_Noop -JE DebugStub_ProcessCommand2_Exit +JE DebugStub_ProcessCommandNew_Exit Mov EAX, 0 Call DebugStub_ComReadAL @@ -14,19 +14,60 @@ Mov [DebugStub_CommandID], EAX Mov EAX, [ESP + 0] Cmp EAX, DebugStub_Const_Vs2Ds_TraceOff -JNE DebugStub_ProcessCommand2_Block1End +JNE DebugStub_ProcessCommandNew_Block1End Call DebugStub_TraceOff -Jmp DebugStub_ProcessCommand2_Exit -DebugStub_ProcessCommand2_Block1End: +Jmp DebugStub_ProcessCommandNew_Exit +DebugStub_ProcessCommandNew_Block1End: +Cmp EAX, DebugStub_Const_Vs2Ds_TraceOn +JNE DebugStub_ProcessCommandNew_Block2End +Call DebugStub_TraceOn +Jmp DebugStub_ProcessCommandNew_Exit +DebugStub_ProcessCommandNew_Block2End: +Cmp EAX, DebugStub_Const_Vs2Ds_Break +JNE DebugStub_ProcessCommandNew_Block3End +Call DebugStub_Break +Jmp DebugStub_ProcessCommandNew_Exit +DebugStub_ProcessCommandNew_Block3End: +Cmp EAX, DebugStub_Const_Vs2Ds_BreakOnAddress +JNE DebugStub_ProcessCommandNew_Block4End +Call DebugStub_BreakOnAddress +Jmp DebugStub_ProcessCommandNew_Exit +DebugStub_ProcessCommandNew_Block4End: +Cmp EAX, DebugStub_Const_Vs2Ds_SendMethodContext +JNE DebugStub_ProcessCommandNew_Block5End +Call DebugStub_SendMethodContext +Jmp DebugStub_ProcessCommandNew_Exit +DebugStub_ProcessCommandNew_Block5End: +Cmp EAX, DebugStub_Const_Vs2Ds_SendMemory +JNE DebugStub_ProcessCommandNew_Block6End +Call DebugStub_SendMemory +Jmp DebugStub_ProcessCommandNew_Exit +DebugStub_ProcessCommandNew_Block6End: +Cmp EAX, DebugStub_Const_Vs2Ds_SendRegisters +JNE DebugStub_ProcessCommandNew_Block7End +Call DebugStub_SendRegisters +Jmp DebugStub_ProcessCommandNew_Exit +DebugStub_ProcessCommandNew_Block7End: +Cmp EAX, DebugStub_Const_Vs2Ds_SendFrame +JNE DebugStub_ProcessCommandNew_Block8End +Call DebugStub_SendFrame +Jmp DebugStub_ProcessCommandNew_Exit +DebugStub_ProcessCommandNew_Block8End: +Cmp EAX, DebugStub_Const_Vs2Ds_SendStack +JNE DebugStub_ProcessCommandNew_Block9End +Call DebugStub_SendStack +Jmp DebugStub_ProcessCommandNew_Exit +DebugStub_ProcessCommandNew_Block9End: +Cmp EAX, DebugStub_Const_Vs2Ds_Ping +JNE DebugStub_ProcessCommandNew_Block10End +Call DebugStub_Ping +Jmp DebugStub_ProcessCommandNew_Exit +DebugStub_ProcessCommandNew_Block10End: -DebugStub_ProcessCommand2_Exit: +DebugStub_ProcessCommandNew_Exit: Pop EAX Ret -DebugStub_CheckCmd2: -DebugStub_CheckCmd2_Exit: -Ret - DebugStub_AckCommand: Mov AL, DebugStub_Const_Ds2Vs_CmdCompleted diff --git a/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.xs b/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.xs index 98b20591c..eb6e24f60 100644 --- a/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.xs +++ b/source2/Compiler/Cosmos.Compiler.DebugStub/CmdProcess.xs @@ -2,7 +2,7 @@ // Modifies: AL, DX (ComReadAL) // Returns: AL -function ProcessCommand2 { +function ProcessCommandNew { ComReadAL() // Some callers expect AL to be returned, so we preserve it // in case any commands modify AL. @@ -25,16 +25,42 @@ function ProcessCommand2 { TraceOff() return } - //CheckCmd("TraceOff", Vs2Ds.TraceOff) - //CheckCmd("TraceOn", Vs2Ds.TraceOn) - //CheckCmd("Break", Vs2Ds.Break) - //CheckCmd("BreakOnAddress", Vs2Ds.BreakOnAddress) - //CheckCmd("SendMethodContext", Vs2Ds.SendMethodContext) - //CheckCmd("SendMemory", Vs2Ds.SendMemory) - //CheckCmd("SendRegisters", Vs2Ds.SendRegisters) - //CheckCmd("SendFrame", Vs2Ds.SendFrame) - //CheckCmd("SendStack", Vs2Ds.SendStack) - //CheckCmd("Ping", Vs2Ds.Ping) + if EAX = #Vs2Ds_TraceOn { + TraceOn() + return + } + if EAX = #Vs2Ds_Break { + Break() + return + } + if EAX = #Vs2Ds_BreakOnAddress { + BreakOnAddress() + return + } + if EAX = #Vs2Ds_SendMethodContext { + SendMethodContext() + return + } + if EAX = #Vs2Ds_SendMemory { + SendMemory() + return + } + if EAX = #Vs2Ds_SendRegisters { + SendRegisters() + return + } + if EAX = #Vs2Ds_SendFrame { + SendFrame() + return + } + if EAX = #Vs2Ds_SendStack { + SendStack() + return + } + if EAX = #Vs2Ds_Ping { + Ping() + return + } Exit: // Restore AL for callers who check the command and do @@ -42,16 +68,6 @@ Exit: -EAX } -function CheckCmd2 { -// AL.Compare(aCmd) -// string xAfterLabel = NewLabel() -// JumpIf(Flags.NotEqual, xAfterLabel) -// Call("DebugStub_" + aLabel) -// Call("DebugStub_AckCommand") -// Jump(".End") -// Label = xAfterLabel -} - function AckCommand { // We acknowledge receipt of the command AND the processing of it. // -In the past the ACK only acknowledged receipt. diff --git a/source2/Compiler/Cosmos.Compiler.DebugStub/Old/DebugStub.cs b/source2/Compiler/Cosmos.Compiler.DebugStub/Old/DebugStub.cs index 54769096d..382b5bfbe 100644 --- a/source2/Compiler/Cosmos.Compiler.DebugStub/Old/DebugStub.cs +++ b/source2/Compiler/Cosmos.Compiler.DebugStub/Old/DebugStub.cs @@ -167,7 +167,7 @@ namespace Cosmos.Debug.DebugStub { // If a command is waiting, process it and then check for another. // If no command waiting, break from loop. JumpIf(Flags.Zero, ".CheckForCmd_Break"); - Call(); + Call("DebugStub_ProcessCommand"); // See if there are more commands waiting Jump(".CheckForCmd"); @@ -191,7 +191,7 @@ namespace Cosmos.Debug.DebugStub { Label = ".WaitCmd"; { // Check for common commands first - Call(); + Call("DebugStub_ProcessCommand"); // Now check for commands that are only valid in break state or commands that require special handling while in break state.