From cfb4e0a35f74a57ab29bb9cde2b4b7220c85828d Mon Sep 17 00:00:00 2001
From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498>
Date: Sat, 9 Jul 2011 21:55:46 +0000
Subject: [PATCH]
---
.../Cosmos.Compiler.DebugStub/DebugStub.cs | 44 ++++++++++++++++---
.../Cosmos.Debug.Common/DebugConnector.cs | 5 ++-
.../DebugConnectorPipeServer.cs | 4 +-
.../DebugConnectorStream.cs | 26 ++++++++---
.../Cosmos.Debug.VSDebugEngine/ReadMe.html | 10 +++--
.../Cosmos.VS.WindowsPackage.cs | 5 +++
source2/VSIP/Cosmos.VS.Windows/StackUC.xaml | 8 ++--
.../VSIP/Cosmos.VS.Windows/StackUC.xaml.cs | 43 +++++++++---------
8 files changed, 98 insertions(+), 47 deletions(-)
diff --git a/source2/Compiler/Cosmos.Compiler.DebugStub/DebugStub.cs b/source2/Compiler/Cosmos.Compiler.DebugStub/DebugStub.cs
index a7584024b..22c676e89 100644
--- a/source2/Compiler/Cosmos.Compiler.DebugStub/DebugStub.cs
+++ b/source2/Compiler/Cosmos.Compiler.DebugStub/DebugStub.cs
@@ -192,12 +192,46 @@ namespace Cosmos.Compiler.DebugStub {
public class WriteALToComPort : CodeBlock {
// Input: AL
// Output: None
- // Modifies: EAX, EDX, ESI
+ // Modifies: EDX, ESI
public override void Assemble() {
EAX.Push();
ESI = ESP;
Call("WriteByteToComPort");
- EAX.Pop(); // Is a local var, cant use Return(4). X# issues the return.
+ // Is a local var, cant use Return(4). X# issues the return.
+ // This also allow the function to preserve EAX.
+ EAX.Pop();
+ }
+ }
+
+ public class WriteAXToComPort : CodeBlock {
+ // Input: AX
+ // Output: None
+ // Modifies: EDX, ESI
+ public override void Assemble() {
+ EAX.Push();
+ ESI = ESP;
+ Call("WriteByteToComPort");
+ Call("WriteByteToComPort");
+ // Is a local var, cant use Return(4). X# issues the return.
+ // This also allow the function to preserve EAX.
+ EAX.Pop();
+ }
+ }
+
+ public class WriteEAXToComPort : CodeBlock {
+ // Input: EAX
+ // Output: None
+ // Modifies: EDX, ESI
+ public override void Assemble() {
+ EAX.Push();
+ ESI = ESP;
+ Call("WriteByteToComPort");
+ Call("WriteByteToComPort");
+ Call("WriteByteToComPort");
+ Call("WriteByteToComPort");
+ // Is a local var, cant use Return(4). X# issues the return.
+ // This also allow the function to preserve EAX.
+ EAX.Pop();
}
}
@@ -295,11 +329,9 @@ namespace Cosmos.Compiler.DebugStub {
ESI = Memory["DebugESP", 32];
// Send number of bytes
- ESI = Memory["DebugEBP", 32];
+ EAX = Memory["DebugEBP", 32];
EAX.Sub(ESI);
- Call
- Program: /RootSuffix Exp "M:\source\Cosmos\source\Cosmos.sln"
- Parameters: /RootSuffix Exp "M:\source\Cosmos\source\Cosmos.sln"
Debugging via Hive
+ Parameters: /RootSuffix Exp "M:\source\Cosmos\source\Cosmos.sln"
++ Can also debug non hive, but some exceptions are not masked.