Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hosting SOS under ClrMd for ELF dumps. #124

Merged
merged 6 commits into from
Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vsts-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ phases:
- agent.os -equals Windows_NT
variables:
_PublishBlobFeedUrl: https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
_SOSNETCorePath: $(Build.SourcesDirectory)/artifacts/bin/SOS.NETCore/Release/netcoreapp2.0/publish
_SOSNETCorePath: $(Build.SourcesDirectory)/artifacts/bin/SOS.NETCore/Release/netstandard2.0/publish
_TeamName: DotNetCore

steps:
Expand Down Expand Up @@ -433,7 +433,7 @@ phases:
displayName: Publish TestHelpers to MyGet dotnet-buildtools feed
inputs:
command: custom
arguments: 'push $(Build.SourcesDirectory)\artifacts\packages\Release\NonShipping\Microsoft.Diagnostic.TestHelpers.*.nupkg -ApiKey $(dotnetfeed-storage-access-key-1) -Source $(_PublishBlobFeedUrl)'
arguments: 'push $(Build.SourcesDirectory)\artifacts\packages\Release\Shipping\Microsoft.Diagnostic.TestHelpers.*.nupkg -ApiKey $(dotnetfeed-storage-access-key-1) -Source $(_PublishBlobFeedUrl)'
condition: and(succeeded(), eq(variables['PushPackages'], 'true'))

- task: PublishBuildArtifacts@1
Expand Down
2 changes: 1 addition & 1 deletion NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
Expand Down
86 changes: 86 additions & 0 deletions diagnostics.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SOS.InstallHelper", "src\SO
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-sos", "src\Tools\dotnet-sos\dotnet-sos.csproj", "{41351955-16D5-48D7-AF4C-AF25F5FB2E78}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SOS.Hosting", "src\SOS\SOS.Hosting\SOS.Hosting.csproj", "{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostic.Repl", "src\Microsoft.Diagnostic.Repl\Microsoft.Diagnostic.Repl.csproj", "{90CF2633-58F0-44EE-943B-D70207455F20}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Checked|Any CPU = Checked|Any CPU
Expand Down Expand Up @@ -593,6 +597,86 @@ Global
{41351955-16D5-48D7-AF4C-AF25F5FB2E78}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{41351955-16D5-48D7-AF4C-AF25F5FB2E78}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
{41351955-16D5-48D7-AF4C-AF25F5FB2E78}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Checked|Any CPU.Build.0 = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Checked|ARM.ActiveCfg = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Checked|ARM.Build.0 = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Checked|ARM64.ActiveCfg = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Checked|ARM64.Build.0 = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Checked|x64.ActiveCfg = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Checked|x64.Build.0 = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Checked|x86.ActiveCfg = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Checked|x86.Build.0 = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Debug|ARM.ActiveCfg = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Debug|ARM.Build.0 = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Debug|ARM64.Build.0 = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Debug|x64.ActiveCfg = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Debug|x64.Build.0 = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Debug|x86.ActiveCfg = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Debug|x86.Build.0 = Debug|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Release|Any CPU.Build.0 = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Release|ARM.ActiveCfg = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Release|ARM.Build.0 = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Release|ARM64.ActiveCfg = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Release|ARM64.Build.0 = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Release|x64.ActiveCfg = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Release|x64.Build.0 = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Release|x86.ActiveCfg = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.Release|x86.Build.0 = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.RelWithDebInfo|ARM.ActiveCfg = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.RelWithDebInfo|ARM.Build.0 = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.RelWithDebInfo|ARM64.ActiveCfg = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.RelWithDebInfo|ARM64.Build.0 = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Checked|Any CPU.Build.0 = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Checked|ARM.ActiveCfg = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Checked|ARM.Build.0 = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Checked|ARM64.ActiveCfg = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Checked|ARM64.Build.0 = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Checked|x64.ActiveCfg = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Checked|x64.Build.0 = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Checked|x86.ActiveCfg = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Checked|x86.Build.0 = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Debug|ARM.ActiveCfg = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Debug|ARM.Build.0 = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Debug|ARM64.Build.0 = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Debug|x64.ActiveCfg = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Debug|x64.Build.0 = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Debug|x86.ActiveCfg = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Debug|x86.Build.0 = Debug|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Release|Any CPU.Build.0 = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Release|ARM.ActiveCfg = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Release|ARM.Build.0 = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Release|ARM64.ActiveCfg = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Release|ARM64.Build.0 = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Release|x64.ActiveCfg = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Release|x64.Build.0 = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Release|x86.ActiveCfg = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.Release|x86.Build.0 = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.RelWithDebInfo|ARM.ActiveCfg = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.RelWithDebInfo|ARM.Build.0 = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.RelWithDebInfo|ARM64.ActiveCfg = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.RelWithDebInfo|ARM64.Build.0 = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
{90CF2633-58F0-44EE-943B-D70207455F20}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -615,6 +699,8 @@ Global
{20EBC3C4-917C-402D-B778-9A6E3742BF5A} = {41638A4C-0DAF-47ED-A774-ECBBAC0315D7}
{1F012743-941B-4915-8C55-02097894CF3F} = {41638A4C-0DAF-47ED-A774-ECBBAC0315D7}
{41351955-16D5-48D7-AF4C-AF25F5FB2E78} = {B62728C8-1267-4043-B46F-5537BBAEC692}
{ED27F39F-DF5C-4E22-87E0-EC5B5873B503} = {41638A4C-0DAF-47ED-A774-ECBBAC0315D7}
{90CF2633-58F0-44EE-943B-D70207455F20} = {19FAB78C-3351-4911-8F0C-8C6056401740}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {46465737-C938-44FC-BE1A-4CE139EBB5E0}
Expand Down
7 changes: 7 additions & 0 deletions eng/Build-Native.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,13 @@ if /i "%__DoCrossArchBuild%"=="1" (
endlocal
)

REM Copy the native SOS binaries to where these tools expect for testing

set "__dotnet_sos=%__RootBinDir%\bin\dotnet-sos\%__BuildType%\netcoreapp2.1\publish\win-%__BuildArch%"
set "__dotnet_dump=%__RootBinDir%\bin\dotnet-dump\%__BuildType%\netcoreapp2.1\publish\win-%__BuildArch%"
xcopy /y /q /i /s %__BinDir% %__dotnet_sos%
xcopy /y /q /i /s %__BinDir% %__dotnet_dump%

REM =========================================================================================
REM ===
REM === All builds complete!
Expand Down
4 changes: 3 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<!-- Other libs -->
<MicrosoftSymbolStoreVersion>1.0.0-dev-63716-01</MicrosoftSymbolStoreVersion>
<MicrosoftDiagnosticsRuntimeVersion>1.0.3</MicrosoftDiagnosticsRuntimeVersion>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -28,7 +29,8 @@
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
https://dotnet.myget.org/F/symstore/api/v3/index.json;
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;
https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json;
https://dotnet.myget.org/F/system-commandline/api/v3/index.json
</RestoreSources>
</PropertyGroup>
</Project>
8 changes: 8 additions & 0 deletions eng/build-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,14 @@ if [ $__Build == true ]; then
fi

build_native "$__BuildArch" "$__IntermediatesDir" "$__ExtraCmakeArgs"

# Copy the native SOS binaries to where these tools expect for testing
__dotnet_sos=$__RootBinDir/bin/dotnet-sos/$__BuildType/netcoreapp2.1/publish/$__DistroRid
__dotnet_dump=$__RootBinDir/bin/dotnet-dump/$__BuildType/netcoreapp2.1/publish/$__DistroRid
mkdir -p "$__dotnet_sos"
mkdir -p "$__dotnet_dump"
cp "$__BinDir"/* "$__dotnet_sos"
cp "$__BinDir"/* "$__dotnet_dump"
fi

# Run SOS/lldbplugin tests
Expand Down
2 changes: 1 addition & 1 deletion eng/create-gallery-zip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $BinDir = "$SourceDirectory\artifacts\bin"
$SOSGalleryVersion = cat $BinDir\VersionPrefix.txt
$SOSGalleryVersion = "$SOSGalleryVersion" + ".0"

$SOSNETCorePath = "$BinDir\SOS.NETCore\Release\netcoreapp2.0\publish"
$SOSNETCorePath = "$BinDir\SOS.NETCore\Release\netstandard2.0\publish"
$GalleryDir = "$BinDir\gallery\$SOSGalleryVersion"
$ZipFilePath = "$SourceDirectory\artifacts\packages\Release"
$ZipFile = Join-Path -Path $ZipFilePath "$SOSGalleryVersion.zip"
Expand Down
61 changes: 61 additions & 0 deletions src/Microsoft.Diagnostic.Repl/Command/Attributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// --------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// --------------------------------------------------------------------
using System;

namespace Microsoft.Diagnostic.Repl
{
/// <summary>
/// Base command option attribute.
/// </summary>
public class BaseAttribute : Attribute
{
/// <summary>
/// Name of the command
/// </summary>
public string Name;

/// <summary>
/// Displayed in the help for the command
/// </summary>
public string Help;
}

/// <summary>
/// Marks the class as a Command.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class CommandAttribute : BaseAttribute
{
/// <summary>
/// Sets the value of the CommandBase.AliasExpansion when the command is executed.
/// </summary>
public string AliasExpansion;
}

/// <summary>
/// Marks the property as a Option.
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public class OptionAttribute : BaseAttribute
{
}

/// <summary>
/// Adds an alias to the Option. Help is ignored.
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public class OptionAliasAttribute : BaseAttribute
{
}

/// <summary>
/// Marks the property the command Argument.
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public class ArgumentAttribute : BaseAttribute
{
}
}
59 changes: 59 additions & 0 deletions src/Microsoft.Diagnostic.Repl/Command/CommandBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// --------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// --------------------------------------------------------------------
using System;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.Threading.Tasks;

namespace Microsoft.Diagnostic.Repl
{
/// <summary>
/// The common command context
/// </summary>
public abstract class CommandBase
{
public const string EntryPointName = nameof(InvokeAsync);

/// <summary>
/// Parser invocation context. Contains the ParseResult, CommandResult, etc.
/// </summary>
public InvocationContext InvocationContext { get; set; }

/// <summary>
/// Console instance
/// </summary>
public IConsole Console { get { return InvocationContext.Console; } }

/// <summary>
/// The AliasExpansion value from the CommandAttribute or null if none.
/// </summary>
public string AliasExpansion { get; set; }

/// <summary>
/// Execute the command
/// </summary>
public abstract Task InvokeAsync();

/// <summary>
/// Display text
/// </summary>
/// <param name="message">text message</param>
protected void WriteLine(string message)
{
Console.Out.WriteLine(message);
}

/// <summary>
/// Display formatted text
/// </summary>
/// <param name="format">format string</param>
/// <param name="args">arguments</param>
protected void WriteLine(string format, params object[] args)
{
Console.Out.WriteLine(string.Format(format, args));
}
}
}
Loading