diff --git a/source2/VSIP/Cosmos.VS.Windows/AsmLine.cs b/source2/VSIP/Cosmos.VS.Windows/AsmLine.cs index 99f0f8f99..a9c173155 100644 --- a/source2/VSIP/Cosmos.VS.Windows/AsmLine.cs +++ b/source2/VSIP/Cosmos.VS.Windows/AsmLine.cs @@ -9,6 +9,11 @@ namespace Cosmos.VS.Windows { public class AsmCode : AsmLine { protected string mText; + public string Text { + get { return mText; } + set { mText = value; } + } + public override string ToString() { return mText; } diff --git a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs index 40b9ff6e3..94cb5bc02 100644 --- a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs +++ b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Windows; @@ -14,7 +15,7 @@ namespace Cosmos.VS.Windows { /// /// This class derives from the ToolWindowPane class provided from the MPF in order to use its /// implementation of the IVsUIElementPane interface. - // + [Guid("f019fb29-c2c2-4d27-9abf-739533c939be")] public class AssemblyTW : ToolWindowPane2 { public AssemblyTW() { @@ -55,6 +56,12 @@ namespace Cosmos.VS.Windows { } void butnStep_Click(object sender, RoutedEventArgs e) { + var xCodeLinesQry = from x in mLines + where x is AsmCode + select (AsmCode)x; + var xCodeLines = xCodeLinesQry.Where(q => q.Text.ToUpper() != "INT3").ToArray(); + var xCodeLine = xCodeLines[1]; + MessageBox.Show(xCodeLine.Label.Label); //Global.PipeUp.SendCommand(Cosmos.Debug.Consts.DwCmd.AsmStep, null); } @@ -90,12 +97,6 @@ namespace Cosmos.VS.Windows { continue; } - // Insert a blank line before labels, but not if its the top line - if (tblkSource.Inlines.Count > 0) { - tblkSource.Inlines.Add(new LineBreak()); - mCode.AppendLine(); - } - if (xLabelPrefix == null) { var xLabelParts = xAsmLabel.Label.Split('.'); xLabelPrefix = xLabelParts[0] + "."; @@ -107,7 +108,7 @@ namespace Cosmos.VS.Windows { continue; } } - xDisplayLine = "\t" + xLine.ToString(); + xDisplayLine = xLine.ToString(); } // Replace all and not just labels so we get jumps, calls etc @@ -116,6 +117,16 @@ namespace Cosmos.VS.Windows { } } + if (xLine is AsmLabel) { + // Insert a blank line before labels, but not if its the top line + if (tblkSource.Inlines.Count > 0) { + tblkSource.Inlines.Add(new LineBreak()); + mCode.AppendLine(); + } + } else { + xDisplayLine = "\t" + xDisplayLine; + } + // Even though our code is often the source of the tab, it makes // more sense to do it this was because the number of space stays // in one place and also lets us differentiate from natural spaces.