Skip to content

Commit

Permalink
Merge pull request #1327 from microsoft/main
Browse files Browse the repository at this point in the history
Merge 'main' into 'release-cpptools'
  • Loading branch information
WardenGnaw authored Jul 6, 2022
2 parents ef2420c + 018e50f commit b4bbd66
Show file tree
Hide file tree
Showing 22 changed files with 326 additions and 80 deletions.
66 changes: 9 additions & 57 deletions .github/workflows/Build-And-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uses: darenm/Setup-VSTest@v1

- name: Run VS Extension tests
run: vstest.console.exe ${{ github.workspace }}\bin\${{ matrix.configuration }}\MICoreUnitTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\JDbgUnitTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\SSHDebugTests.dll
run: vstest.console.exe ${{ github.workspace }}\bin\${{ matrix.configuration }}\MICoreUnitTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\JDbgUnitTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\SSHDebugTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\MIDebugEngineUnitTests.dll

windows_vscode_build:
runs-on: windows-latest
Expand Down Expand Up @@ -80,61 +80,11 @@ jobs:
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
msystem: MINGW64
path-type: inherit
update: true
install: >-
mingw-w64-x86_64-toolchain
# As of Nov 8, 2021, mingw-w64-x86_64-toolchain-11.1.x
# causes GDB to return "During startup program exited with code 0xc0000139"
# Downgrade to working toolchain (04-May-2021)
# TODO: Remove this task when there is a newer version of toolchain than 11.1.x
- shell: msys2 {0}
name: Downgrade toolchain to 10.x
run: |
# Download GDB
DOWNLOAD_DOWNGRADED_GDB_PATH='${{ github.workspace }}/mingw-w64-x86_64-gdb-10.2-2-any.pkg.tar.zst'
DOWNLOAD_DOWNGRADED_GDB_PATH=${DOWNLOAD_DOWNGRADED_GDB_PATH//\\//}
wget -O ${DOWNLOAD_DOWNGRADED_GDB_PATH} http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gdb-10.2-2-any.pkg.tar.zst
# Download GCC
DOWNLOAD_DOWNGRADED_GCC_PATH='${{ github.workspace }}/mingw-w64-x86_64-gcc-10.3.0-8-any.pkg.tar.zst'
DOWNLOAD_DOWNGRADED_GCC_PATH=${DOWNLOAD_DOWNGRADED_GCC_PATH//\\//}
wget -O ${DOWNLOAD_DOWNGRADED_GCC_PATH} http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-10.3.0-8-any.pkg.tar.zst
# Download GCC Lib
DOWNLOAD_DOWNGRADED_GCCLIB_PATH='${{ github.workspace }}/mingw-w64-x86_64-gcc-libs-10.3.0-8-any.pkg.tar.zst'
DOWNLOAD_DOWNGRADED_GCCLIB_PATH=${DOWNLOAD_DOWNGRADED_GCCLIB_PATH//\\//}
wget -O ${DOWNLOAD_DOWNGRADED_GCCLIB_PATH} http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.3.0-8-any.pkg.tar.zst
# Download GCC Ada
DOWNLOAD_DOWNGRADED_ADA_PATH='${{ github.workspace }}/mingw-w64-x86_64-gcc-ada-10.3.0-8-any.pkg.tar.zst'
DOWNLOAD_DOWNGRADED_ADA_PATH=${DOWNLOAD_DOWNGRADED_ADA_PATH//\\//}
wget -O ${DOWNLOAD_DOWNGRADED_ADA_PATH} http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-ada-10.3.0-8-any.pkg.tar.zst
# Download GCC Fortran
DOWNLOAD_DOWNGRADED_FORTRAN_PATH='${{ github.workspace }}/mingw-w64-x86_64-gcc-fortran-10.3.0-8-any.pkg.tar.zst'
DOWNLOAD_DOWNGRADED_FORTRAN_PATH=${DOWNLOAD_DOWNGRADED_FORTRAN_PATH//\\//}
wget -O ${DOWNLOAD_DOWNGRADED_FORTRAN_PATH} http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-fortran-10.3.0-8-any.pkg.tar.zst
# Download GCC Libfortran
DOWNLOAD_DOWNGRADED_LIBFORTRAN_PATH='${{ github.workspace }}/mingw-w64-x86_64-gcc-libgfortran-10.3.0-8-any.pkg.tar.zst'
DOWNLOAD_DOWNGRADED_LIBFORTRAN_PATH=${DOWNLOAD_DOWNGRADED_LIBFORTRAN_PATH//\\//}
wget -O ${DOWNLOAD_DOWNGRADED_LIBFORTRAN_PATH} http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libgfortran-10.3.0-8-any.pkg.tar.zst
# Download GCC Obj-C
DOWNLOAD_DOWNGRADED_OBJC_PATH='${{ github.workspace }}/mingw-w64-x86_64-gcc-objc-10.3.0-8-any.pkg.tar.zst'
DOWNLOAD_DOWNGRADED_OBJC_PATH=${DOWNLOAD_DOWNGRADED_OBJC_PATH//\\//}
wget -O ${DOWNLOAD_DOWNGRADED_OBJC_PATH} http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-objc-10.3.0-8-any.pkg.tar.zst
# Download GCC libgccjit
DOWNLOAD_DOWNGRADED_LIBGCCJIT_PATH='${{ github.workspace }}/mingw-w64-x86_64-libgccjit-10.3.0-8-any.pkg.tar.zst'
DOWNLOAD_DOWNGRADED_LIBGCCJIT_PATH=${DOWNLOAD_DOWNGRADED_LIBGCCJIT_PATH//\\//}
wget -O ${DOWNLOAD_DOWNGRADED_LIBGCCJIT_PATH} http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libgccjit-10.3.0-8-any.pkg.tar.zst
# Install
pacman -U --noconfirm $DOWNLOAD_DOWNGRADED_GDB_PATH $DOWNLOAD_DOWNGRADED_GCC_PATH $DOWNLOAD_DOWNGRADED_GCCLIB_PATH $DOWNLOAD_DOWNGRADED_ADA_PATH $DOWNLOAD_DOWNGRADED_FORTRAN_PATH $DOWNLOAD_DOWNGRADED_LIBFORTRAN_PATH $DOWNLOAD_DOWNGRADED_OBJC_PATH $DOWNLOAD_DOWNGRADED_LIBGCCJIT_PATH
- shell: msys2 {0}
name: Gather c++ toolchain paths
Expand All @@ -144,10 +94,12 @@ jobs:
cygpath -w $(which gdb)
gdb --version
- run: |
set PATH="%PATH%;D:\a\_temp\msys64\mingw64\bin\"
dotnet test ${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\CppTests.dll --logger "trx;LogFileName=${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\results.trx"
- shell: msys2 {0}
name: Run tests
run: |
export CppTestsPath=$(cygpath -u "${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\CppTests.dll")
export ResultsPath=$(cygpath -u "${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\results.trx")
dotnet test $CppTestsPath --logger "trx;LogFileName=$ResultsPath"
- name: 'Upload Test Results'
uses: actions/upload-artifact@v2
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ MIEngine can be built with either [Visual Studio](https://visualstudio.microsoft
* See the [wiki](https://github.com/Microsoft/MIEngine/wiki) for more info.

### Contribute!
Before you contribute, please read through the contributing and developer guides to get an idea of requirements for pull requests.

* [Contributing Guide](https://github.com/Microsoft/MIEngine/wiki/Contributing-Code)
* [Developer Guide](https://github.com/Microsoft/MIEngine/wiki/Building-Testing-and-Debugging)
Before you contribute, please read through the [Contributing Guide](https://github.com/Microsoft/MIEngine/wiki/Contributing-Code) to get an idea of requirements for pull requests.

Want to get more familiar with what's going on in the code?
* [Pull requests](https://github.com/Microsoft/MIEngine/pulls): [Open](https://github.com/Microsoft/MIEngine/pulls?q=is%3Aopen+is%3Apr)/[Closed](https://github.com/Microsoft/MIEngine/pulls?q=is%3Apr+is%3Aclosed)
Expand Down
4 changes: 2 additions & 2 deletions build/package_versions.settings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<PropertyGroup>
<Microsoft_VisualStudio_Debugger_Interop_Portable_Version>1.0.1</Microsoft_VisualStudio_Debugger_Interop_Portable_Version>
<Microsoft_VisualStudio_Interop_Version>17.0.0-previews-1-31410-258</Microsoft_VisualStudio_Interop_Version>
<Newtonsoft_Json_Version>12.0.2</Newtonsoft_Json_Version>
<Microsoft_VisualStudio_Shared_VSCodeDebugProtocol_Version>17.0.50801.1</Microsoft_VisualStudio_Shared_VSCodeDebugProtocol_Version>
<Newtonsoft_Json_Version>13.0.1</Newtonsoft_Json_Version>
<Microsoft_VisualStudio_Shared_VSCodeDebugProtocol_Version>17.2.60629.1</Microsoft_VisualStudio_Shared_VSCodeDebugProtocol_Version>

<!-- Test Packages -->
<Microsoft_NET_Test_Sdk_Version>16.7.1</Microsoft_NET_Test_Sdk_Version>
Expand Down
13 changes: 13 additions & 0 deletions src/DebugEngineHost/DebugEngineHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@

<Import Project="..\..\build\Debugger.PIAs.NonPortable.Packages.settings.targets" />


<!--
This ItemGroup is to override the packages that being depended on for the PackageReferences above.
The issue is that Microsoft.VisualStudio.Shell.Framework v17.2.32505.113 ->
Microsoft.ServiceHub.[Client|Framework] ->
StreamJsonRpc v2.7.70 ->
Newtonsoft.Json v12.0.2
Delete this explicit override when we update 'Microsoft_VisualStudio_Shell_Framework_Version' away from v17.2.32505.113
-->
<ItemGroup Label="Component Governance Override">
<PackageReference Include="Newtonsoft.Json" Version="$(Newtonsoft_Json_Version)" />
</ItemGroup>

<ItemGroup Label="NuGet Packages">
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="$(Microsoft_VisualStudio_Shell_15_0_Version)">
<IncludeAssets>compile</IncludeAssets>
Expand Down
10 changes: 10 additions & 0 deletions src/JDbgUnitTests/JDbgUnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<!--
This ItemGroup is to override the packages that being depended on for the PackageReferences above.
The issue is that Microsoft.NET.Test.Sdk ->
Newtonsoft.Json v12.0.2
Delete this explicit override when we update 'Microsoft_VisualStudio_Shell_Framework_Version' away from v17.2.32505.113
-->
<ItemGroup Label="Component Governance Override">
<PackageReference Include="Newtonsoft.Json" Version="$(Newtonsoft_Json_Version)" />
</ItemGroup>

<ItemGroup Label="NuGet Packages">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(Microsoft_NET_Test_Sdk_Version)" />
<PackageReference Include="xunit" Version="$(xunit_Version)" />
Expand Down
9 changes: 8 additions & 1 deletion src/MICore/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@

namespace MICore
{
public interface ILogger
{
void WriteLine(string line);

void WriteLine(string format, params object[] args);
}

/// <summary>
/// Class which implements logging. The logging is control by a registry key. If enabled, logging goes to %TMP%\Microsoft.MIDebug.log
/// </summary>
public class Logger
public class Logger : ILogger
{
private static bool s_isInitialized;
private static bool s_isEnabled;
Expand Down
11 changes: 11 additions & 0 deletions src/MICoreUnitTests/MICoreUnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<!--
This ItemGroup is to override the packages that being depended on for the PackageReferences above.
The issue is that Microsoft.NET.Test.Sdk ->
Newtonsoft.Json v12.0.2
Delete this explicit override when we update 'Microsoft_VisualStudio_Shell_Framework_Version' away from v17.2.32505.113
-->
<ItemGroup Label="Component Governance Override">
<PackageReference Include="Newtonsoft.Json" Version="$(Newtonsoft_Json_Version)" />
</ItemGroup>


<ItemGroup Label="NuGet Packages">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(Microsoft_NET_Test_Sdk_Version)">
<IncludeAssets>compile</IncludeAssets>
Expand Down
10 changes: 10 additions & 0 deletions src/MIDebugEngine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{20B91EF1
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MakePIAPortableTool", "tools\MakePIAPortableTool\MakePIAPortableTool.csproj", "{CC5BDD33-7EB1-4FB9-BC67-806773018989}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MIDebugEngineUnitTests", "MIDebugEngineUnitTests\MIDebugEngineUnitTests.csproj", "{7F98435A-526E-41DC-9F9A-BFD55CC991DE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -278,6 +280,14 @@ Global
{CC5BDD33-7EB1-4FB9-BC67-806773018989}.Lab.Release|Any CPU.Build.0 = Lab.Release|Any CPU
{CC5BDD33-7EB1-4FB9-BC67-806773018989}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC5BDD33-7EB1-4FB9-BC67-806773018989}.Release|Any CPU.Build.0 = Release|Any CPU
{7F98435A-526E-41DC-9F9A-BFD55CC991DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F98435A-526E-41DC-9F9A-BFD55CC991DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F98435A-526E-41DC-9F9A-BFD55CC991DE}.Lab.Debug|Any CPU.ActiveCfg = Lab.Debug|Any CPU
{7F98435A-526E-41DC-9F9A-BFD55CC991DE}.Lab.Debug|Any CPU.Build.0 = Lab.Debug|Any CPU
{7F98435A-526E-41DC-9F9A-BFD55CC991DE}.Lab.Release|Any CPU.ActiveCfg = Lab.Release|Any CPU
{7F98435A-526E-41DC-9F9A-BFD55CC991DE}.Lab.Release|Any CPU.Build.0 = Lab.Release|Any CPU
{7F98435A-526E-41DC-9F9A-BFD55CC991DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F98435A-526E-41DC-9F9A-BFD55CC991DE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
21 changes: 14 additions & 7 deletions src/MIDebugEngine/Natvis.Impl/Natvis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public uint Size()
}
}

internal class VisualizerWrapper : SimpleWrapper
internal sealed class VisualizerWrapper : SimpleWrapper
{
public readonly Natvis.VisualizerInfo Visualizer;
private readonly bool _isVisualizerView;
Expand Down Expand Up @@ -1086,12 +1086,19 @@ private string ReplaceNamesInExpression(string expression, IVariableInformation
{
return ProcessNamesInString(expression, new Substitute[] {
(m)=>
{ // finds children of this structure and sub's in the fullname of the child
IVariableInformation var = variable == null ? null : variable.FindChildByName(m.Value);
if (var != null) // found a child
{
return "(" + var.FullName() + ")";
}
{
if (variable == null)
return null;

// replace explicit this references
if (m.Value == "this")
return (variable.TypeName.EndsWith("*", StringComparison.Ordinal) ? "(" : "(&") + variable.FullName() + ")";

// finds children of this structure and sub's in the fullname of the child
IVariableInformation child = variable.FindChildByName(m.Value);
if (child != null)
return "(" + child.FullName() + ")";

return null;
},
(m)=>
Expand Down
10 changes: 5 additions & 5 deletions src/MIDebugEngine/Natvis.Impl/NatvisNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ private void SetArraySize(int[] Dims)
@"^(signed\s+char|unsigned\s+char|char16_t|char32_t|wchar_t|char|"
+ @"signed\s+short\s+int|signed\s+short|unsigned\s+short\s+int|unsigned\s+short|short\s+int|short|"
+ @"signed\s+int|unsigned\s+int|int|"
+ @"signed\s+long\s+int|unsigned\s+long\s+int|long\s+int|long|"
+ @"signed\s+long\s+long\s+int|long\s+long\s+int|unsigned\s+long\s+long\s+int|long\s+long"
+ @"signed\s+long\s+int|unsigned\s+long\s+int|"
+ @"signed\s+long\s+long\s+int|long\s+long\s+int|long\s+int|unsigned\s+long\s+long\s+int|long\s+long"
+ @"float|double|"
+ @"long\s+double|bool|void)\b" // matches prefixes ending in '$' (e.g. void$Foo), these are checked for below
+ @"long\s+double|long|bool|void)\b" // matches prefixes ending in '$' (e.g. void$Foo), these are checked for below
);
private static readonly TypeName s_any = new TypeName()
{
Expand Down Expand Up @@ -138,15 +138,15 @@ public bool Match(TypeName t)
/// </summary>
/// <param name="fullyQualifiedName"></param>
/// <returns></returns>
public static TypeName Parse(string fullyQualifiedName, Logger logger)
public static TypeName Parse(string fullyQualifiedName, ILogger logger)
{
if (String.IsNullOrEmpty(fullyQualifiedName))
return null;
string rest = null;
TypeName t = MatchTypeName(fullyQualifiedName.Trim(), out rest);
if (!String.IsNullOrWhiteSpace(rest))
{
logger.WriteLine("Natvis failed to parse typename: " + fullyQualifiedName);
logger.WriteLine("Natvis failed to parse typename: {0}", fullyQualifiedName);
return null;
}
return t;
Expand Down
5 changes: 4 additions & 1 deletion src/MIDebugEngine/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("42127a66-b150-42db-8ca0-a4f059e60e6e")]
[assembly: Guid("42127a66-b150-42db-8ca0-a4f059e60e6e")]

// Allows MIDebugEngineUnitTests to access internal classes for testing.
[assembly: InternalsVisibleTo("MIDebugEngineUnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100653b46738aa8d82f195b27b17982973efdbb5186bf3527246108bc1653b338a3a452eb99b7ca5a425008aefe385c7e463b5a99eed4c15a786b539480e7d3dd9fe404db485dd3bb9ba85aea38be088d7412337494f9a2d525a920a4c064acde81e4c4fe1e070f4900e7b2d6e0d4cd855c062cb3feb48011fffa98734f12e987f1")]
47 changes: 47 additions & 0 deletions src/MIDebugEngineUnitTests/MIDebugEngineUnitTests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\miengine.settings.targets" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<IsPackable>false</IsPackable>

<AssemblyOriginatorKeyFile>..\..\Keys\ExternalKey.snk</AssemblyOriginatorKeyFile>
<SignAssembly>True</SignAssembly>
<OutputPath>$(MIDefaultOutputPath)</OutputPath>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<!--
This ItemGroup is to override the packages that being depended on for the PackageReferences above.
The issue is that Microsoft.NET.Test.Sdk ->
Newtonsoft.Json v12.0.2
Delete this explicit override when we update 'Microsoft_VisualStudio_Shell_Framework_Version' away from v17.2.32505.113
-->
<ItemGroup Label="Component Governance Override">
<PackageReference Include="Newtonsoft.Json" Version="$(Newtonsoft_Json_Version)" />
</ItemGroup>

<ItemGroup Label="NuGet Packages">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(Microsoft_NET_Test_Sdk_Version)" />
<PackageReference Include="xunit" Version="$(xunit_Version)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(xunit_runner_visualstudio_Version)">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="$(coverlet_collector_Version)">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Label="Project References">
<ProjectReference Include="..\DebugEngineHost.Stub\DebugEngineHost.Stub.csproj">
<Project>{ea876a2d-ab0f-4204-97dd-dfb3b5568978}</Project>
<Name>DebugEngineHost.Stub</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\MIDebugEngine\MIDebugEngine.csproj" />
</ItemGroup>

<Import Project="..\..\build\miengine.targets" />

</Project>
Loading

0 comments on commit b4bbd66

Please sign in to comment.