diff --git a/source/Cosmos.sln b/source/Cosmos.sln index 7f30ddcc9..030e86539 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 = "9626" + VWDPort = "10155" 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/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs b/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs index d379cb044..5548e1fb2 100644 --- a/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs +++ b/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs @@ -630,15 +630,19 @@ namespace Cosmos.Debug.VSDebugEngine { // Get assembly source var xCode = AsmSource.GetSourceForLabels(Path.ChangeExtension(mISO, ".asm"), xLabels); - // Get label for current address - var xCurrentLabel = (from x in mAddressLabelMappings - where x.Key == (uint)mCurrentAddress - select x.Value).FirstOrDefault(); - if (xCurrentLabel == null) { + // Get label for current address. + // A single address can have multiple labels (IL, Asm). Because of this we search + // for the one with the Asm tag. We dont have the tags in this debug info though, + // so instead if there is more than one label we use the last one which is the Asm tag. + var xCurrentLabelsQry = (from x in mAddressLabelMappings + where (x.Key == (uint)mCurrentAddress) + select x.Value); + var xCurrentLabels = xCurrentLabelsQry.ToArray(); + if (xCurrentLabels.Length == 0) { return; } // Insert it to the first line of our data stream - xCode.Insert(0, xCurrentLabel + "\r\n"); + xCode.Insert(0, xCurrentLabels[xCurrentLabels.Length - 1] + "\r\n"); mDebugDownPipe.SendCommand(VsipUi.AssemblySource, Encoding.UTF8.GetBytes(xCode.ToString())); } diff --git a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs index 43c065d73..c3a183754 100644 --- a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs +++ b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs @@ -144,8 +144,14 @@ namespace Cosmos.VS.Windows { xRun.Foreground = Brushes.Black; } else if (xLine is AsmComment) { xRun.Foreground = Brushes.Green; - } else { + } else if (xLine is AsmCode) { + var xAsmCode = (AsmCode)xLine; + if (xAsmCode.Label != null && xAsmCode.Label.Label == mCurrentLabel) { + xRun.Background = Brushes.Red; + } xRun.Foreground = Brushes.Blue; + } else { // Unknown type + xRun.Foreground = Brushes.HotPink; } tblkSource.Inlines.Add(xRun); @@ -163,7 +169,7 @@ namespace Cosmos.VS.Windows { } // Used for creating a test file for Cosmos.VS.Windows.Test - if (true) { + if (false) { System.IO.File.WriteAllBytes(@"D:\source\Cosmos\source2\VSIP\Cosmos.VS.Windows.Test\SourceTest.bin", mData); }