diff --git a/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs b/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs
index 98a46b768..d593d678a 100644
--- a/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs
+++ b/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs
@@ -50,14 +50,42 @@ namespace Cosmos.Debug.VSDebugEngine {
// Pipe to receive messages from Cosmos.VS.Windows
static private Cosmos.Debug.Common.PipeServer mDebugUpPipe = null;
+ protected void DeleteFiles(string aPath, string aPattern) {
+ var xFiles = Directory.GetFiles(aPath, aPattern);
+ foreach (var xFile in xFiles) {
+ File.Delete(xFile);
+ }
+ }
+
protected void LaunchVMWare(bool aGDB) {
string xPath = Path.Combine(PathUtilities.GetBuildDir(), @"VMWare\Workstation") + @"\";
string xDebugVmx = "Debug.vmx";
+ // VMWare doesn't like to boot a read only VMX.
+ // We also need to make changes based on project / debug settings.
+ // Finally we do not want to create VCS checkins based on local user changes.
+ // Because of this we use Cosmos.vmx as a template and output a Debug.vmx on
+ // every run.
using (var xSrc = new StreamReader(xPath + "Cosmos.vmx")) {
try {
- // This copy process also leaves the VMX writeable. VMWare doesnt like them read only.
- using (var xDest = new StreamWriter(xPath + xDebugVmx)) {
+ // Delete old Debug.vmx and other files that might be left over from previous run
+ // Especially important with newer versions of VMWare player which defaults to suspend
+ // when the close button is used.
+ File.Delete(Path.Combine(xPath, xDebugVmx));
+ File.Delete(Path.Combine(xPath, Path.ChangeExtension(xDebugVmx, ".nvram")));
+ // Delete the auto snapshots that latest vmware players create as default
+ // It creates them with suffixes though, so we need to wild card find them
+ DeleteFiles(xPath, "*.vmxf");
+ DeleteFiles(xPath, "*.vmss");
+ DeleteFiles(xPath, "*.vmsd");
+ DeleteFiles(xPath, "*.vmem");
+ // Delete log files so that logged data is only from last boot
+ File.Delete(Path.Combine(xPath, "vmware.log"));
+ File.Delete(Path.Combine(xPath, "vmware-0.log"));
+ File.Delete(Path.Combine(xPath, "vmware-1.log"));
+ File.Delete(Path.Combine(xPath, "vmware-2.log"));
+ // Write out Debug.vmx
+ using (var xDest = new StreamWriter(Path.Combine(xPath, xDebugVmx))) {
string xLine;
while ((xLine = xSrc.ReadLine()) != null) {
var xParts = xLine.Split('=');
@@ -70,6 +98,8 @@ namespace Cosmos.Debug.VSDebugEngine {
xValue = null;
} else if (xName == "ide1:0.fileName") {
xValue = "\"" + mDebugInfo["ISOFile"] + "\"";
+ } else if (xName == "nvram") {
+ xValue = "\"Debug.nvram\"";
}
if (xValue != null) {
@@ -86,8 +116,9 @@ namespace Cosmos.Debug.VSDebugEngine {
}
}
} catch (IOException e) {
- if (e.Message.Contains(xDebugVmx))
+ if (e.Message.Contains(xDebugVmx)) {
throw new Exception("The Vmware image " + xDebugVmx + " is still in use! Please exit current Vmware session with Cosmos and try again!", e);
+ }
throw e;
}
}
diff --git a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml
index 49023293b..c6255f028 100644
--- a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml
+++ b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml
@@ -15,9 +15,6 @@
-
-
-
diff --git a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs
index 643e37a5c..0de4c0a0f 100644
--- a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs
+++ b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs
@@ -64,8 +64,6 @@ namespace Cosmos.VS.Windows {
butnFilter.Click += new RoutedEventHandler(butnFilter_Click);
butnCopy.Click += new RoutedEventHandler(mitmCopy_Click);
butnStep.Click += new RoutedEventHandler(butnStep_Click);
- butnPingVSIP.Click += new RoutedEventHandler(butnPingVSIP_Click);
- butnPingDS.Click += new RoutedEventHandler(butnPingDS_Click);
Update(null, mData);
}
@@ -73,18 +71,11 @@ namespace Cosmos.VS.Windows {
void butnStep_Click(object sender, RoutedEventArgs e) {
}
- void butnPingDS_Click(object sender, RoutedEventArgs e) {
- }
-
void butnFilter_Click(object sender, RoutedEventArgs e) {
mFilter = !mFilter;
Display(mFilter);
}
- void butnPingVSIP_Click(object sender, RoutedEventArgs e) {
- Global.mPipeUp.SendCommand(Cosmos.Debug.Consts.DwCmd.PingVSIP, null);
- }
-
void mitmCopy_Click(object sender, RoutedEventArgs e) {
Clipboard.SetText(mCode.ToString());
}
diff --git a/source2/VSIP/Cosmos.VS.Windows/Guids.cs b/source2/VSIP/Cosmos.VS.Windows/Guids.cs
index e4b0827ae..236081c27 100644
--- a/source2/VSIP/Cosmos.VS.Windows/Guids.cs
+++ b/source2/VSIP/Cosmos.VS.Windows/Guids.cs
@@ -1,10 +1,11 @@
// Guids.cs
-// MUST match guids.h - There is no such file???? I think its referencing old VS2005 style, but vsct is used now instead
+// MUST match guids.h - There is no such file???? I think its referencing old VS2005 style, but vsct is used now instead.
using System;
namespace Cosmos.VS.Windows {
static class GuidList {
public const string guidCosmos_VS_WindowsPkgString = "a82b45e9-2a89-43bd-925d-c7f0edd212aa";
+ // What is guidToolWindowPersistanceString used for?
public const string guidToolWindowPersistanceString = "f019fb29-c2c2-4d27-9abf-739533c939be";
public const string guidAsmToolbarCmdSetString = "A875EA24-689A-4EAB-B9C2-DAC3EACB9501";
public const string guidCosmosMenuString = "3247C3E4-34B8-4DB0-8748-AD62495A5222";
diff --git a/source2/VSIP/Cosmos.VS.Windows/InternalUC.xaml b/source2/VSIP/Cosmos.VS.Windows/InternalUC.xaml
index f475ec0a4..242c4de7b 100644
--- a/source2/VSIP/Cosmos.VS.Windows/InternalUC.xaml
+++ b/source2/VSIP/Cosmos.VS.Windows/InternalUC.xaml
@@ -6,7 +6,10 @@
xmlns:local="clr-namespace:Cosmos.VS.Windows"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
-
-
-
+
+
+
+
+
+
diff --git a/source2/VSIP/Cosmos.VS.Windows/InternalUC.xaml.cs b/source2/VSIP/Cosmos.VS.Windows/InternalUC.xaml.cs
index 939a15631..1741a3a42 100644
--- a/source2/VSIP/Cosmos.VS.Windows/InternalUC.xaml.cs
+++ b/source2/VSIP/Cosmos.VS.Windows/InternalUC.xaml.cs
@@ -39,6 +39,16 @@ namespace Cosmos.VS.Windows {
public partial class InternalUC : DebuggerUC {
public InternalUC() {
InitializeComponent();
+
+ butnPingVSIP.Click += new RoutedEventHandler(butnPingVSIP_Click);
+ butnPingDS.Click += new RoutedEventHandler(butnPingDS_Click);
+ }
+
+ void butnPingDS_Click(object sender, RoutedEventArgs e) {
+ }
+
+ void butnPingVSIP_Click(object sender, RoutedEventArgs e) {
+ Global.mPipeUp.SendCommand(Cosmos.Debug.Consts.DwCmd.PingVSIP, null);
}
}
}