mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-23 06:18:54 +00:00
This commit is contained in:
parent
d6a829c5c6
commit
17dbb4b2e5
3 changed files with 19 additions and 9 deletions
|
|
@ -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}"
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue