Tests and debugger fixes.

This commit is contained in:
José Pedro 2017-05-01 21:19:50 +01:00
parent 7228f90bc4
commit 0dccc8e69b
18 changed files with 85 additions and 44 deletions

View file

@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<TargetFramework>netcoreapp1.1</TargetFramework>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\Cosmos.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170425-07" />
<PackageReference Include="NUnit" Version="3.7.0-dev-03862" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0-ci-00452-pr-313" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170427-09" />
<PackageReference Include="NUnit" Version="3.7.0-dev-03886" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0-ci-00457-pr-313" />
</ItemGroup>
<ItemGroup>

View file

@ -25,11 +25,11 @@ build_script:
xcopy /Y "%APPVEYOR_BUILD_FOLDER%\Build\VSIP\Cosmos.targets" "%ProgramFiles(x86)%\MSBuild\Cosmos\"
dotnet publish source/Cosmos.Build.MSBuild -f net462 -r win7-x86 -o "c:\CosmosRun\Build\VSIP\"
dotnet publish source/Cosmos.Build.MSBuild -f net462 -r win7-x86 -c Release -o "c:\CosmosRun\Build\VSIP\"
dotnet publish source/IL2CPU -f netcoreapp1.0 -r win7-x86 -o "c:\CosmosRun\Build\IL2CPU\"
dotnet publish source/IL2CPU -f netcoreapp1.0 -r win7-x86 -c Release -o "c:\CosmosRun\Build\IL2CPU\"
dotnet publish source/XSharp.Compiler -f netcoreapp1.0 -r win7-x86 -o "c:\CosmosRun\Build\XSharp\"
dotnet publish source/XSharp.Compiler -f netcoreapp1.0 -r win7-x86 -c Release -o "c:\CosmosRun\Build\XSharp\"
xcopy /Y "c:\Cosmos\Build\VSIP\Cosmos.Debug.Kernel.*" "c:\CosmosRun\Kernel\"

View file

@ -102,6 +102,7 @@ namespace Cosmos.Debug.Hosts
}
_bochsStartInfo.Arguments = string.Format("-q {1} -f \"{0}\"", _bochsConfigurationFile.FullName, xExtraLog);
_bochsStartInfo.WorkingDirectory = _bochsConfigurationFile.Directory.FullName;
_bochsStartInfo.CreateNoWindow = true; // when ProcessStartInfo.UseShellExecute is supported in .net core, maybe this line isn't needed
//_bochsStartInfo.UseShellExecute = true;
if (RedirectOutput)
{

View file

@ -25,7 +25,7 @@ namespace Cosmos.VS.DebugEngine.AD7.Impl
// IDebugEngineProgram2: This interface provides simultanious debugging of multiple threads in a debuggee.
[ComVisible(true)]
[Guid("DC8503AB-7EE6-456C-A209-66C690D9F6F4")]
[Guid(Guids.guidDebugEngineString)]
public class AD7Engine : IDebugEngine2, IDebugEngineLaunch2, IDebugProgram3, IDebugEngineProgram2
{
internal IDebugProgram2 mProgram;
@ -33,7 +33,7 @@ namespace Cosmos.VS.DebugEngine.AD7.Impl
internal AD7Process mProcess;
// A unique identifier for the program being debugged.
Guid mProgramID;
public const string ID = "FA1DA3A6-66FF-4C65-B077-E65F7164EF83";
public static readonly Guid EngineID = new Guid("{fa1da3a6-66ff-4c65-b077-e65f7164ef83}");
internal AD7Module mModule;
internal AD7Thread mThread;
private AD7ProgramNode mProgNode;
@ -256,7 +256,7 @@ namespace Cosmos.VS.DebugEngine.AD7.Impl
int IDebugEngine2.GetEngineId(out Guid oGuidEngine)
{
// Gets the GUID of the DebugEngine.
oGuidEngine = new Guid(ID);
oGuidEngine = EngineID;
return VSConstants.S_OK;
}
@ -332,7 +332,7 @@ namespace Cosmos.VS.DebugEngine.AD7.Impl
// Gets the name and identifier of the debug engine (DE) running this program.
engineName = Resources.EngineName;
engineGuid = new Guid(AD7Engine.ID);
engineGuid = EngineID;
return VSConstants.S_OK;
}

View file

@ -23,7 +23,7 @@ namespace Cosmos.VS.DebugEngine.AD7.Impl
int IDebugProgramNode2.GetEngineInfo(out string oEngineName, out Guid oEngineGuid)
{
oEngineName = Resources.EngineName;
oEngineGuid = new Guid(AD7Engine.ID);
oEngineGuid = AD7Engine.EngineID;
return VSConstants.S_OK;
}

View file

@ -29,7 +29,7 @@ namespace Cosmos.VS.DebugEngine.Commands
return hr;
if (string.IsNullOrWhiteSpace(arguments))
throw new ArgumentException("Expected an MI command to execute (ex: Debug.MIDebugExec info sharedlibrary)");
throw new ArgumentException("Expected a Cosmos command to execute (ex: Debug.CosmosDebugExec info sharedlibrary)");
DebugExec(arguments);

View file

@ -47,8 +47,8 @@ namespace Cosmos.VS.DebugEngine.Commands
return hr;
if (hr == VSConstants.S_OK || parseCommandLine.HasSwitches() != VSConstants.S_OK)
{
string message = string.Concat("Unexpected syntax for MIDebugLaunch command. Expected:\n",
"Debug.MIDebugLaunch /Executable:<path_or_logical_name> /OptionsFile:<path>");
string message = string.Concat("Unexpected syntax for CosmosDebugLaunch command. Expected:\n",
"Debug.CosmosDebugLaunch /Executable:<path_or_logical_name> /OptionsFile:<path>");
throw new ApplicationException(message);
}

View file

@ -47,8 +47,8 @@ namespace Cosmos.VS.DebugEngine.Commands
return hr;
if (hr == VSConstants.S_OK || parseCommandLine.HasSwitches() != VSConstants.S_OK)
{
string message = string.Concat("Unexpected syntax for MIDebugLaunch command. Expected:\n",
"Debug.MIDebugLog [/On:<optional_path> [/OutputWindow] | /Off]");
string message = string.Concat("Unexpected syntax for CosmosDebugLaunch command. Expected:\n",
"Debug.CosmosDebugLog [/On:<optional_path> [/OutputWindow] | /Off]");
throw new ApplicationException(message);
}

View file

@ -26,13 +26,12 @@
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
@ -105,6 +104,15 @@
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\Cosmos.ico">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<VSCTCompile Include="VSPackage.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
<SubType>Designer</SubType>
</VSCTCompile>
</ItemGroup>
<ItemGroup>
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
@ -119,9 +127,6 @@
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.CommandBars, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualStudio.CoreUtility">
<HintPath>..\..\packages\Microsoft.VisualStudio.CoreUtility.15.0.26201\lib\net45\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
<Private>True</Private>
@ -292,9 +297,6 @@
<ManifestResourceName>VSPackage</ManifestResourceName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\CosmosDebugEnginePackage.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View file

@ -1,21 +1,15 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.ComponentModel.Design;
using System.IO;
using Cosmos.VS.DebugEngine.Commands;
using Microsoft.Win32;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Cosmos.VS.DebugEngine.Commands;
namespace Cosmos.VS.DebugEngine
{
[PackageRegistration(UseManagedResourcesOnly = true)]
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
//[ProvideMenuResource("Menus.ctmenu", 1)]
[ProvideMenuResource("Menus.ctmenu", 1)]
[Guid(Guids.guidPackageString)]
public sealed class CosmosDebugEnginePackage : Package, IOleCommandTarget
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 KiB

View file

@ -135,6 +135,6 @@
<value>CosmosDebugEnginePackage Visual Studio Extension Detailed Info</value>
</data>
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\CosmosDebugEnginePackage.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>Resources\Cosmos.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<Extern href="stdidcmd.h" />
<Extern href="vsshlids.h" />
<Commands package="guidDebugPackage">
<Buttons>
<Button guid="guidDebugPackageCmdSet" id="cmdidLaunchDebug" priority="0x0100" type="Button">
<CommandFlag>AllowParams</CommandFlag>
<Strings>
<ButtonText>Cosmos Debug Launch</ButtonText>
<CanonicalName>Debug.CosmosDebugLaunch</CanonicalName>
<LocCanonicalName>Debug.CosmosDebugLaunch</LocCanonicalName>
</Strings>
</Button>
<Button guid="guidDebugPackageCmdSet" id="cmdidDebugExec" priority="0x0100" type="Button">
<CommandFlag>AllowParams</CommandFlag>
<Strings>
<ButtonText>Cosmos Debug Execute Command</ButtonText>
<CanonicalName>Debug.CosmosDebugExec</CanonicalName>
<LocCanonicalName>Debug.CosmosDebugExec</LocCanonicalName>
</Strings>
</Button>
<Button guid="guidDebugPackageCmdSet" id="cmdidDebugLog" priority="0x0100" type="Button">
<CommandFlag>AllowParams</CommandFlag>
<Strings>
<ButtonText>Cosmos Debug Control Logging</ButtonText>
<CanonicalName>Debug.CosmosDebugLog</CanonicalName>
<LocCanonicalName>Debug.CosmosDebugLog</LocCanonicalName>
</Strings>
</Button>
</Buttons>
</Commands>
<Symbols>
<GuidSymbol name="guidDebugPackage" value="{A82B45E9-2A89-43BD-925D-C7F0EDD212AA}" />
<GuidSymbol name="guidDebugPackageCmdSet" value="{94EBFC49-EC0F-4BD3-B3FF-D3AADB8DAC9F}">
<IDSymbol name="cmdidLaunchDebug" value="0x0100" />
<IDSymbol name="cmdidDebugExec" value="0x0101" />
<IDSymbol name="cmdidDebugLog" value="0x0102" />
</GuidSymbol>
</Symbols>
</CommandTable>

View file

@ -2,8 +2,9 @@
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Cosmos.VS.DebugEngine" Version="1.0" Language="en-US" Publisher="Cosmos" />
<DisplayName>Cosmos.VS.DebugEngine</DisplayName>
<DisplayName>Cosmos Visual Studio Debug Engine</DisplayName>
<Description xml:space="preserve">Visual Studio Debug Engine for Cosmos</Description>
<Icon>Resources\Cosmos.ico</Icon>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0]" />

View file

@ -4,8 +4,6 @@
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<UseCodebase>true</UseCodebase>
</PropertyGroup>
<PropertyGroup>

View file

@ -4,13 +4,14 @@ using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using Cosmos.Build.Common;
using Cosmos.Debug.Common;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Project;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Cosmos.Build.Common;
using Cosmos.Debug.Common;
namespace Cosmos.VS.ProjectSystem
{
public class CosmosProjectConfig : ProjectConfig
@ -90,9 +91,9 @@ namespace Cosmos.VS.ProjectSystem
xInfo.bstrExe = DictionaryHelper.DumpToString(xValues);
// Select the debugger
xInfo.clsidCustom = new Guid("{FA1DA3A6-66FF-4c65-B077-E65F7164EF83}"); // Debug engine identifier.
xInfo.clsidCustom = Cosmos.VS.DebugEngine.AD7.Impl.AD7Engine.EngineID; // Debug engine identifier.
// ??? This identifier doesn't seems to appear anywhere else in souce code.
xInfo.clsidPortSupplier = new Guid("{708C1ECA-FF48-11D2-904F-00C04FA302A1}");
//xInfo.clsidPortSupplier = new Guid("{708C1ECA-FF48-11D2-904F-00C04FA302A1}");
VsShellUtilities.LaunchDebugger(ProjectMgr.Site, xInfo);
}

View file

@ -2,7 +2,7 @@
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Cosmos.VS.ProjectSystem" Version="1.0" Language="en-US" Publisher="Cosmos" />
<DisplayName> Cosmos Visual Studio Project System</DisplayName>
<DisplayName>Cosmos Visual Studio Project System</DisplayName>
<Description xml:space="preserve">The Visual Studio project system for the Cosmos Operating System.</Description>
<Icon>Resources\Cosmos.ico</Icon>
</Metadata>