mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 14:02:19 +00:00
This commit is contained in:
parent
c0e6f255b4
commit
0b7916a4bb
3 changed files with 63 additions and 27 deletions
|
|
@ -88,7 +88,7 @@ Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Docs", "..\Docs", "{67E7DEF
|
||||||
Release.AspNetCompiler.ForceOverwrite = "true"
|
Release.AspNetCompiler.ForceOverwrite = "true"
|
||||||
Release.AspNetCompiler.FixedNames = "false"
|
Release.AspNetCompiler.FixedNames = "false"
|
||||||
Release.AspNetCompiler.Debug = "False"
|
Release.AspNetCompiler.Debug = "False"
|
||||||
VWDPort = "53094"
|
VWDPort = "11354"
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Compiler.Debug", "..\source2\IL2CPU\Cosmos.IL2CPU.Debug\Cosmos.Compiler.Debug.csproj", "{9998B4EA-385E-4DA2-8905-2BBEB5B2C6E2}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Compiler.Debug", "..\source2\IL2CPU\Cosmos.IL2CPU.Debug\Cosmos.Compiler.Debug.csproj", "{9998B4EA-385E-4DA2-8905-2BBEB5B2C6E2}"
|
||||||
|
|
|
||||||
|
|
@ -491,22 +491,53 @@ namespace Cosmos.Debug.VSDebugEngine {
|
||||||
public void SendAssembly()
|
public void SendAssembly()
|
||||||
{
|
{
|
||||||
//Get Current BP Label
|
//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
|
// Get ASM lines
|
||||||
string xAsmDocumentName = Path.ChangeExtension(mISO, "asm");
|
string xAsmDocumentName = Path.ChangeExtension(mISO, "asm");
|
||||||
string xFile;
|
string xAsmFile;
|
||||||
string[] xFileLines;
|
string[] xFileLines;
|
||||||
|
var xData = new StringBuilder();
|
||||||
using (var xTR = new StreamReader(xAsmDocumentName))
|
using (var xTR = new StreamReader(xAsmDocumentName))
|
||||||
{
|
{
|
||||||
xFile = xTR.ReadToEnd();
|
xAsmFile = xTR.ReadToEnd();
|
||||||
}
|
}
|
||||||
xFile = xFile.Replace('\r', ' ');
|
xAsmFile = xAsmFile.Replace('\r', ' ');
|
||||||
xFile = xFile.Trim();
|
xAsmFile = xAsmFile.Trim();
|
||||||
xFileLines = xFile.Split('\n');
|
xFileLines = xAsmFile.Split('\n');
|
||||||
|
for (int a = 0; a < xCurrentBPLabel.Count; a++)
|
||||||
|
{
|
||||||
int k = 0, l = 0;
|
int k = 0, l = 0;
|
||||||
for (int j = 0; j < xFileLines.Length; j++)
|
for (int j = 0; j < xFileLines.Length; j++)
|
||||||
{
|
{
|
||||||
if (xFileLines[j].Contains(xCurrendBPLabel))
|
if (xFileLines[j].Contains(xCurrentBPLabel[a]))
|
||||||
{
|
{
|
||||||
k = j;
|
k = j;
|
||||||
j++;
|
j++;
|
||||||
|
|
@ -517,11 +548,11 @@ namespace Cosmos.Debug.VSDebugEngine {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var xData = new StringBuilder();
|
|
||||||
for (int j = k; j < l; j++)
|
for (int j = k; j < l; j++)
|
||||||
{
|
{
|
||||||
xData.AppendLine(xFileLines[j]);
|
xData.AppendLine(xFileLines[j]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
DebugWindows.SendCommand(DwMsgType.AssemblySource, Encoding.ASCII.GetBytes(xData.ToString()));
|
DebugWindows.SendCommand(DwMsgType.AssemblySource, Encoding.ASCII.GetBytes(xData.ToString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,8 +143,13 @@ namespace Cosmos.Cosmos_VS_Windows
|
||||||
|
|
||||||
void ProcessMessage(object sender, EventArgs e)
|
void ProcessMessage(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var xCmd = mCommand.Dequeue();
|
byte xCmd = 0x0;
|
||||||
var xMsg = mMessage.Dequeue();
|
byte[] xMsg = {0x0};
|
||||||
|
if ((mCommand.Count > 0) && (mMessage.Count > 0))
|
||||||
|
{
|
||||||
|
xCmd = mCommand.Dequeue();
|
||||||
|
xMsg = mMessage.Dequeue();
|
||||||
|
}
|
||||||
switch (xCmd)
|
switch (xCmd)
|
||||||
{
|
{
|
||||||
case DwMsgType.Noop:
|
case DwMsgType.Noop:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue