This commit is contained in:
Sentinel209_cp 2011-07-05 06:11:26 +00:00
parent c0e6f255b4
commit 0b7916a4bb
3 changed files with 63 additions and 27 deletions

View file

@ -88,7 +88,7 @@ Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Docs", "..\Docs", "{67E7DEF
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "53094"
VWDPort = "11354"
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Compiler.Debug", "..\source2\IL2CPU\Cosmos.IL2CPU.Debug\Cosmos.Compiler.Debug.csproj", "{9998B4EA-385E-4DA2-8905-2BBEB5B2C6E2}"

View file

@ -491,37 +491,68 @@ namespace Cosmos.Debug.VSDebugEngine {
public void SendAssembly()
{
//Get Current BP Label
string xCurrendBPLabel = mAddressLabelMappings[(uint)mCurrentAddress];
bool xDone = false;
string xFile = string.Empty;
int xLine = 0;
int xCol = 0;
IList<uint> xKeys = mSourceMappings.Keys;
IList<SourceInfo> xValues = mSourceMappings.Values;
List<string> xCurrentBPLabel = new List<string>();
xCurrentBPLabel.Add(mAddressLabelMappings[(uint)mCurrentAddress]);
int xIdx = xKeys.IndexOf((uint)mCurrentAddress);
xFile = xValues[xIdx].SourceFile;
xLine = xValues[xIdx].Line;
xCol = xValues[xIdx].Column;
while (!xDone)
{
xIdx++;
if (xIdx < xValues.Count)
{
SourceInfo xSI = xValues[xIdx];
if ((xSI.SourceFile == xFile) && (xSI.Line == xLine) && (xSI.Column == xCol))
{
xCurrentBPLabel.Add(mAddressLabelMappings[xKeys[xIdx]]);
}
else
{
xDone = true;
}
}
}
// Get ASM lines
string xAsmDocumentName = Path.ChangeExtension(mISO, "asm");
string xFile;
string xAsmFile;
string[] xFileLines;
var xData = new StringBuilder();
using (var xTR = new StreamReader(xAsmDocumentName))
{
xFile = xTR.ReadToEnd();
xAsmFile = xTR.ReadToEnd();
}
xFile = xFile.Replace('\r', ' ');
xFile = xFile.Trim();
xFileLines = xFile.Split('\n');
int k = 0, l = 0;
for (int j = 0; j < xFileLines.Length; j++)
xAsmFile = xAsmFile.Replace('\r', ' ');
xAsmFile = xAsmFile.Trim();
xFileLines = xAsmFile.Split('\n');
for (int a = 0; a < xCurrentBPLabel.Count; a++)
{
if (xFileLines[j].Contains(xCurrendBPLabel))
{
k = j;
j++;
}
if ((k != 0) && (xFileLines[j].Contains("System")))
{
l = j - 2;
break;
}
}
var xData = new StringBuilder();
for (int j = k; j < l; j++)
{
xData.AppendLine(xFileLines[j]);
}
int k = 0, l = 0;
for (int j = 0; j < xFileLines.Length; j++)
{
if (xFileLines[j].Contains(xCurrentBPLabel[a]))
{
k = j;
j++;
}
if ((k != 0) && (xFileLines[j].Contains("System")))
{
l = j - 2;
break;
}
}
for (int j = k; j < l; j++)
{
xData.AppendLine(xFileLines[j]);
}
}
DebugWindows.SendCommand(DwMsgType.AssemblySource, Encoding.ASCII.GetBytes(xData.ToString()));
}
}

View file

@ -143,8 +143,13 @@ namespace Cosmos.Cosmos_VS_Windows
void ProcessMessage(object sender, EventArgs e)
{
var xCmd = mCommand.Dequeue();
var xMsg = mMessage.Dequeue();
byte xCmd = 0x0;
byte[] xMsg = {0x0};
if ((mCommand.Count > 0) && (mMessage.Count > 0))
{
xCmd = mCommand.Dequeue();
xMsg = mMessage.Dequeue();
}
switch (xCmd)
{
case DwMsgType.Noop: