Debugger pipe work.

This commit is contained in:
kudzu_cp 2011-09-13 01:51:54 +00:00
parent b69139311e
commit 733d3de69b
4 changed files with 149 additions and 144 deletions

View file

@ -86,7 +86,7 @@ Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Docs", "..\Docs", "{67E7DEF
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "6281"
VWDPort = "28453"
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}"

View file

@ -125,6 +125,10 @@ namespace Cosmos.Debug.Common
SendCommand(DsCmd.SendStack);
}
public void Ping() {
SendCommand(DsCmd.Ping);
}
public void SetBreakpoint(int aID, uint aAddress) {
// Not needed as SendCommand will do it, but it saves
// some execution, but more importantly stops it from

View file

@ -19,7 +19,7 @@ namespace Cosmos.Debug.Common {
// We need to delay creation and connect until its used, so we guarantee
// that the server side is active and ready.
if (mPipe == null) {
mPipe = new NamedPipeClientStream(".", Cosmos.Debug.Consts.Pipes.DownName, PipeDirection.Out);
mPipe = new NamedPipeClientStream(".", mPipeName, PipeDirection.Out);
try {
// For now we assume its there or not from the first call.
// If we don't find the server, we disable it to avoid causing lag.
@ -42,11 +42,11 @@ namespace Cosmos.Debug.Common {
if (xData == null) {
xData = new byte[0];
}
int xLength = Math.Min(aData.Length, 32768);
int xLength = Math.Min(xData.Length, 32768);
mPipe.WriteByte((byte)(xLength >> 8));
mPipe.WriteByte((byte)(xLength & 0xFF));
if (xLength > 0) {
mPipe.Write(aData, 0, xLength);
mPipe.Write(xData, 0, xLength);
}
mPipe.Flush();

View file

@ -106,7 +106,6 @@ namespace Cosmos.Debug.VSDebugEngine {
if (String.IsNullOrEmpty(xVmwarePath) || !File.Exists(xVmwarePath)) {
MessageBox.Show("VWMare is not installed, probably going to crash now!", "Cosmos DebugEngine", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private static string GetVMWareWorkstationPath() {
@ -134,18 +133,18 @@ namespace Cosmos.Debug.VSDebugEngine {
mDebugDownPipe.SendCommand(DwMsg.Registers, aData);
}
protected void DbgCmdFrame(byte[] aData)
{
protected void DbgCmdFrame(byte[] aData) {
mDebugDownPipe.SendCommand(DwMsg.Frame, aData);
}
protected void DbgCmdStack(byte[] aData)
{
protected void DbgCmdStack(byte[] aData) {
mDebugDownPipe.SendCommand(DwMsg.Stack, aData);
}
internal AD7Process(NameValueCollection aDebugInfo, EngineCallback aCallback, AD7Engine aEngine, IDebugPort2 aPort)
{
void mDebugUpPipe_DataPacketReceived(byte arg1, byte[] arg2) {
}
internal AD7Process(NameValueCollection aDebugInfo, EngineCallback aCallback, AD7Engine aEngine, IDebugPort2 aPort) {
System.Diagnostics.Debug.WriteLine("In AD7Process..ctor");
mCallback = aCallback;
@ -154,6 +153,8 @@ namespace Cosmos.Debug.VSDebugEngine {
mDebugDownPipe = new Cosmos.Debug.Common.PipeClient(Cosmos.Debug.Consts.Pipes.DownName);
mDebugUpPipe = new Cosmos.Debug.Common.PipeServer(Cosmos.Debug.Consts.Pipes.UpName);
mDebugUpPipe.DataPacketReceived += new Action<byte, byte[]>(mDebugUpPipe_DataPacketReceived);
mDebugUpPipe.Start();
mISO = mDebugInfo["ISOFile"];
mProjectFile = mDebugInfo["ProjectFile"];